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
47
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
2021_11_internal_tech_session__lxd
vsanna2
0
120
AnyPay 社内エンジニアLT オフレコmeetup vol1
vsanna2
0
360
Rails5.1.4 overview
vsanna2
0
89
React Native Router Flux v4 introduction
vsanna2
1
130
Other Decks in Technology
See All in Technology
エンジニア視点で見る、 組織で運用されるデザインシステムにするには
shunya078
1
310
突撃! 隣のAmazon Bedrockユーザー 〜YouはどうしてAWSで?〜
minorun365
PRO
3
390
The XZ Backdoor Story
fr0gger
0
3.6k
「家族アルバム みてね」における運用管理・ オブザーバビリティの全貌 / Overview of Operation Management and Observability in FamilyAlbum
isaoshimizu
4
160
社内の学びの場・コミュニティ形成とエンジニア同士のリレーションシップ構築/devreljapan2024
nishiuma
3
290
なにもしてないのにNew Relicのデータ転送量が増えていたときに確認したこと
tk3fftk
2
230
内製化を目指す事業会社が、システム開発会社と共に進める「開発生産性改善」の取り組み事例 #devsumi
yuwji
0
100
Swift Testingのconfirmationを コードリーディング/Dive into Swift Testing confirmation
laprasdrum
2
260
開発者の定量・定性データを組み合わせて開発者体験を把握するための取り組み
ham0215
1
130
どこよりも遅めなWinActor Ver.7.5.0 新機能紹介
tamai_63
0
210
JEP 480: Structured Concurrency
aya_ebata
0
130
DroidKaigi 2024 たすけて!ViewModel
mhidaka
5
940
Featured
See All Featured
Gamification - CAS2011
davidbonilla
79
5k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
38
9.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
25
3.9k
How to Think Like a Performance Engineer
csswizardry
16
960
Become a Pro
speakerdeck
PRO
22
4.9k
Designing with Data
zakiwarfel
98
5k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
How STYLIGHT went responsive
nonsquared
93
5.1k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.8k
Designing the Hi-DPI Web
ddemaree
278
34k
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) }