Module: B001e::Truthiness
- Defined in:
- lib/b001e/truthiness.rb
Instance Method Summary collapse
- #and ⇒ Object
- #if ⇒ Object
- #ifelse(then_branch = ->{}, _ = nil) ⇒ Object
- #not ⇒ Object
- #or ⇒ Object
- #unless ⇒ Object
- #unlesselse(_ = nil, else_branch = ->{}) ⇒ Object
Instance Method Details
#and ⇒ Object
23 24 25 |
# File 'lib/b001e/truthiness.rb', line 23 def and yield end |
#if ⇒ Object
8 9 10 |
# File 'lib/b001e/truthiness.rb', line 8 def if yield end |
#ifelse(then_branch = ->{}, _ = nil) ⇒ Object
12 13 14 |
# File 'lib/b001e/truthiness.rb', line 12 def ifelse then_branch = ->{}, _ = nil then_branch.() end |
#not ⇒ Object
31 32 33 |
# File 'lib/b001e/truthiness.rb', line 31 def not false end |
#or ⇒ Object
27 28 29 |
# File 'lib/b001e/truthiness.rb', line 27 def or self end |
#unless ⇒ Object
16 17 |
# File 'lib/b001e/truthiness.rb', line 16 def unless end |
#unlesselse(_ = nil, else_branch = ->{}) ⇒ Object
19 20 21 |
# File 'lib/b001e/truthiness.rb', line 19 def unlesselse _ = nil, else_branch = ->{} ifelse else_branch, _ end |