Class: QNil
Overview
Copyright © 2010-2011 Jesse Sielaff
Instance Method Summary collapse
- #and(object) ⇒ Object
- #choose(object_1, object_2) ⇒ Object
- #if(&block) ⇒ Object
- #nil? ⇒ Boolean
- #not ⇒ Object
- #or(object) ⇒ Object
- #stringify ⇒ Object
- #tally ⇒ Object
- #unless(&block) ⇒ Object
- #xor(object) ⇒ Object
Instance Method Details
#and(object) ⇒ Object
7 8 9 |
# File 'lib/q-language/methods/nil.rb', line 7 def and (object) nil end |
#choose(object_1, object_2) ⇒ Object
11 12 13 |
# File 'lib/q-language/methods/nil.rb', line 11 def choose (object_1, object_2) object_2 end |
#if(&block) ⇒ Object
15 16 17 |
# File 'lib/q-language/methods/nil.rb', line 15 def if (&block) nil end |
#nil? ⇒ Boolean
19 20 21 |
# File 'lib/q-language/methods/nil.rb', line 19 def nil? true end |
#not ⇒ Object
23 24 25 |
# File 'lib/q-language/methods/nil.rb', line 23 def not true end |
#or(object) ⇒ Object
27 28 29 |
# File 'lib/q-language/methods/nil.rb', line 27 def or (object) object end |
#stringify ⇒ Object
31 32 33 |
# File 'lib/q-language/methods/nil.rb', line 31 def stringify "nil" end |
#tally ⇒ Object
35 36 37 |
# File 'lib/q-language/methods/nil.rb', line 35 def tally 0 end |
#unless(&block) ⇒ Object
39 40 41 42 |
# File 'lib/q-language/methods/nil.rb', line 39 def unless (&block) env::jump! yield end |
#xor(object) ⇒ Object
44 45 46 |
# File 'lib/q-language/methods/nil.rb', line 44 def xor (object) !!object end |