Class: Ripper::Lexer::State
Instance Attribute Summary collapse
-
#to_int ⇒ Object
(also: #to_i)
readonly
Returns the value of attribute to_int.
-
#to_s ⇒ Object
(also: #inspect)
readonly
Returns the value of attribute to_s.
Instance Method Summary collapse
- #&(i) ⇒ Object
- #==(i) ⇒ Object
- #[](index) ⇒ Object
- #allbits?(i) ⇒ Boolean
- #anybits?(i) ⇒ Boolean
-
#initialize(i) ⇒ State
constructor
A new instance of State.
- #nobits?(i) ⇒ Boolean
- #pretty_print(q) ⇒ Object
- #|(i) ⇒ Object
Constructor Details
Instance Attribute Details
#to_int ⇒ Object (readonly) Also known as: to_i
Returns the value of attribute to_int.
57 58 59 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 57 def to_int @to_int end |
#to_s ⇒ Object (readonly) Also known as: inspect
Returns the value of attribute to_s.
57 58 59 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 57 def to_s @to_s end |
Instance Method Details
#&(i) ⇒ Object
80 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 80 def &(i) self.class.new(to_int & i) end |
#==(i) ⇒ Object
79 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 79 def ==(i) super or to_int == i end |
#[](index) ⇒ Object
65 66 67 68 69 70 71 72 73 74 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 65 def [](index) case index when 0, :to_int @to_int when 1, :to_s @event else nil end end |
#allbits?(i) ⇒ Boolean
82 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 82 def allbits?(i) to_int.allbits?(i) end |
#anybits?(i) ⇒ Boolean
83 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 83 def anybits?(i) to_int.anybits?(i) end |
#nobits?(i) ⇒ Boolean
84 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 84 def nobits?(i) to_int.nobits?(i) end |
#pretty_print(q) ⇒ Object
78 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 78 def pretty_print(q) q.text(to_s) end |
#|(i) ⇒ Object
81 |
# File 'ext/ripper/lib/ripper/lexer.rb', line 81 def |(i) self.class.new(to_int | i) end |