Module: Enumeration::InstanceMethods
- Defined in:
- lib/zkruby/enum.rb
Instance Method Summary collapse
- #&(num) ⇒ Object
- #===(other) ⇒ Object
- #to_i ⇒ Object
- #to_int ⇒ Object
- #to_s ⇒ Object
- #to_sym ⇒ Object
- #|(num) ⇒ Object
Instance Method Details
#&(num) ⇒ Object
38 39 40 |
# File 'lib/zkruby/enum.rb', line 38 def &(num) to_int & num end |
#===(other) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/zkruby/enum.rb', line 15 def === (other) case other when Symbol to_sym == other when Fixnum to_int == other else super end end |
#to_i ⇒ Object
26 27 28 |
# File 'lib/zkruby/enum.rb', line 26 def to_i to_int end |
#to_int ⇒ Object
30 31 32 |
# File 'lib/zkruby/enum.rb', line 30 def to_int @index end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/zkruby/enum.rb', line 46 def to_s "#{super} (:#{@name} [#{@index}])" end |
#to_sym ⇒ Object
42 43 44 |
# File 'lib/zkruby/enum.rb', line 42 def to_sym @name end |
#|(num) ⇒ Object
34 35 36 |
# File 'lib/zkruby/enum.rb', line 34 def |(num) to_int | num end |