Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby2.5.0 overview
Search
ishikawa ryu
April 19, 2018
Technology
0
51
Ruby2.5.0 overview
Ruby2.5.0のリリースを目前に控え、変更点をLT用にまとめ共有した。
ishikawa ryu
April 19, 2018
Tweet
Share
More Decks by ishikawa ryu
See All by ishikawa ryu
SmartNewsにおける 1000+ノード規模 K8s基盤 でのコスト最適化 – Spot・Gravitonの大規模導入への挑戦
vsanna2
1
200
2021_11_internal_tech_session__lxd
vsanna2
0
140
AnyPay 社内エンジニアLT オフレコmeetup vol1
vsanna2
0
370
Rails5.1.4 overview
vsanna2
0
99
React Native Router Flux v4 introduction
vsanna2
1
140
Other Decks in Technology
See All in Technology
トヨタ生産方式(TPS)入門
recruitengineers
PRO
3
310
.NET開発者のためのAzureの概要
tomokusaba
0
230
AIエージェント就活入門 - MCPが履歴書になる未来
eltociear
0
540
KiroでGameDay開催してみよう(準備編)
yuuuuuuu168
1
130
JOAI発表資料 @ 関東kaggler会
joai_committee
1
360
実践アプリケーション設計 ②トランザクションスクリプトへの対応
recruitengineers
PRO
3
330
MySQL HeatWave:サービス概要のご紹介
oracle4engineer
PRO
4
1.7k
LLM時代の検索とコンテキストエンジニアリング
shibuiwilliam
2
1.1k
「AI2027」を紐解く ― AGI・ASI・シンギュラリティ
masayamoriofficial
0
110
Webアクセシビリティ入門
recruitengineers
PRO
1
330
マイクロモビリティシェアサービスを支える プラットフォームアーキテクチャ
grimoh
1
240
新規案件の立ち上げ専門チームから見たAI駆動開発の始め方
shuyakinjo
0
140
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
53
7.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Docker and Python
trallard
45
3.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Code Review Best Practice
trishagee
70
19k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
It's Worth the Effort
3n
187
28k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Balancing Empowerment & Direction
lara
2
590
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Transcript
3VCZ Ξοϓσʔτɻ
3VCZ Ξοϓσʔτ 3ZV *4)*,"8"
3VCZͷϦϦʔε
3VCZͷϦϦʔε
3VCZͷϦϦʔε 3VCZ ʜ 3VCZ 3VCZ 3VCZ 3VCZ 3VCZ 3VCZ ༧ఆ
3VCZ3FMFBTFTcIUUQTXXXSVCZMBOHPSHFOEPXOMPBETSFMFBTFT
5SZJU cd path/to/sandbox && mkdir locale wget https://cache.ruby-lang.org/pub/ruby/2.5/ ruby-2.5.0-preview1.tar.gz tar
xvzf https://cache.ruby-lang.org/pub/ruby/2.5/ ruby-2.5.0-preview1.tar.gz cd ruby-2.5.0-preview1 ./configure —prefix=/path/to/sandbox/local make sudo make install cd ../local ./bin/ruby -v #=> 2.5.0preview1
ओͳมߋ SVCZ/&84BUW@@@QSFWJFXuSVCZSVCZcIUUQTHJUIVCDPNSVCZSVCZCMPCW@@@QSFWJFX/&84
ओͳมߋ SVCZ/&84BUW@@@QSFWJFXuSVCZSVCZcIUUQTHJUIVCDPNSVCZSVCZCMPCW@@@QSFWJFX/&84 ͋ͱͰΑΉ
,FSOFMZJFME@TFMG # ҾʹࣗࣗΛͱΓɺϒϩοΫҾΛฦΓͱ͢Δ(mapͬΆ͍) 2.yield_self { |n| n * 10 }
#=> 20 # tapϒϩοΫͷதΛฦ͢Θ͚Ͱͳ͍ 2.tap { |n| n * 10 } #=> 2 # ϨγʔόͦͷͷΛtapͰॻ͖͑ΔΑ͏ͳॲཧಉ݁͡ՌʹͳΔ [].tap { |arr| arr << 1 << 2 << 3 } [].yield_self { |arr| arr << 1 << 2 << 3 }
,FSOFMZJFME@TFMG require 'rest-client' require 'uri' require 'json' payment_id = 'hogehoge'
endpoint = URI::Generic.build( # 1. endpointͷ࡞ scheme: 'http', # host: 'api.example.com', # path: "/api/v1/payments/#{payment_id}", # port: 3000 # ).to_s # response = RestClient.get(endpoint) # 2. ϦΫΤετ͛Δ response_body = JSON.parse(response.body) # 3. ϨεϙϯεΛjsonͱͯ͠ղऍ͢Δ # puts response_body #=> { version: "1.0.0", response: { message: "..." } }
,FSOFMZJFME@TFMG require 'rest-client' require 'uri' require 'json' payment_id = 'hogehoge'
response_body = URI::Generic.build( # 1. endpointͷ࡞ scheme: 'http', # host: 'api.example.com', # path: "/api/v1/payments/#{payment_id}", # port: 3000 # ).to_s # .yield_self { |endpoint| RestClient.get(endpoint) } # 2. ϦΫΤετ͛Δ .yield_self { |response| JSON.parse(response.body) } # 3. ղऍ͢Δ # puts response_body #=> { version: "1.0.0", response: { message: "..." } }
,FSOFMZJFME@TFMG res = RestClient.get("/users/current") user = JSON.parse(res.body) user_id = user['id']
res = RestClient.get("/users/#{user_id}/friends") friends = JSON.parse(res.body) f_id = friends.last['id'] res = RestClient.get("/users/#{f_id}/profile") profile = JSON.parse(res.body)
,FSOFMZJFME@TFMG profile = RestClient.get("/users/current") .yield_self { |res| JSON.parse(res.body) } .yield_self
{ |user| user['id'] } .yield_self { |user_id| RestClient.get("/users/#{user_id}/ friends") } .yield_self { |res| JSON.parse(res.body) } .yield_self { |friends| friends.last['id'] } .yield_self { |f_id| RestClient.get(“/users/#{f_id}/ profile”) } .yield_self { |res| JSON.parse(res.body) }