Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ruby-flip-flop
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
maimu
June 26, 2024
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ruby-flip-flop
maimu
June 26, 2024
More Decks by maimu
See All by maimu
Gentoo 1年生 ビルドは終わらない
maimux2x
0
100
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
1.5k
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
710
before_rails_girls_after_rails_girls
maimux2x
0
890
my_study_of_ruby_method
maimux2x
1
210
one_liner_fizzbuzz
maimux2x
0
180
about_rails_girls_document_translation
maimux2x
0
6.4k
best_for_fbc
maimux2x
0
88
homemade_service_release_front_and_back
maimux2x
0
520
Other Decks in Programming
See All in Programming
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
770
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
160
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
440
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
180
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
520
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
590
Security issues being discussed on Web Platforms
petamoriken
0
540
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
1.7k
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
130
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
120
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
Skip the Path - Find Your Career Trail
mkilby
1
220
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Designing Powerful Visuals for Engaging Learning
tmiket
1
540
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Exploring anti-patterns in Rails
aemeredith
3
500
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
820
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
270
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
570
Visualization
eitanlees
152
17k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Transcript
Rubyのflip-flop と 仲良くなりたい 2024-06-26 maimu
自己紹介 名前:maimu(@maimux2x) 所属:永和システムマネジメント • フィヨルドブートキャンプ卒業生 • Rails Girls Tokyo 16th
オーガナイザー • 好きなRailsのメソッドはindex_by よろしくお願いします!
Rubyのflip-flopと仲良くなりたい
flip-flopとの出会い
ruby-jpで質問 ぺんさんが考え方を教えてくれた
「..」と「...」の違いが分からない
先ほどの実行例で確認してみる
るりまを見てみる https://docs.ruby-lang.org/ja/latest/doc/spec=2foperator.html 「..」の場合: 1. 初期状態では式1だけを評価し、式1が真を返 すまでは false を返します。 2. 式1が真を返すと
true を返します。式2が真な ら初期状態に戻ります。 3. この後は式2だけを評価し、式2が真を返すま で true を返します。 4. 式2が真を返すと true を返したあと、初期状態 に戻ります。 「...」の場合: 1. 初期状態では式1だけを評価し、式1が真を返 すまでは false を返します。 2. 式1が真を返すと true を返します。 3. この後は式2だけを評価し、式2が真を返すま で true を返します。 4. 式2が真を返すと true を返したあと、初期状態 に戻ります。
るりまのサンプルコードを実行
「..」の場合
「...」の場合
「..」と「...」の違い • 条件式1と条件式2が同じ内容である場合に結果に違いが発生する • 「..」の場合は「条件式に該当する結果」だけが得られる • 「...」の場合は「条件式に該当した結果から次に該当する結果まで」が得られる ◦ 次に該当する結果がなければ条件式に該当後から最後まで
やってみる self-introduction.mdを作成
「..」の場合
「...」の場合
やってみる② sample.mdを作成 るりまのサンプルコードを利用
「..」の場合
「...」の場合
チョット仲良くなれた!
参考資料 • https://docs.ruby-lang.org/ja/latest/doc/spec=2foperator.html • https://qiita.com/Ping/items/acb7fbb9aa141c2c46df