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