Class: Ripper::Lexer::State
- Inherits:
-
Object
- Object
- Ripper::Lexer::State
- Defined in:
- lib/ripper/lexer.rb
Overview
:stopdoc:
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.
58 59 60 |
# File 'lib/ripper/lexer.rb', line 58 def to_int @to_int end |
#to_s ⇒ Object (readonly) Also known as: inspect
Returns the value of attribute to_s.
58 59 60 |
# File 'lib/ripper/lexer.rb', line 58 def to_s @to_s end |
Instance Method Details
#&(i) ⇒ Object
81 |
# File 'lib/ripper/lexer.rb', line 81 def &(i) self.class.new(to_int & i) end |
#==(i) ⇒ Object
80 |
# File 'lib/ripper/lexer.rb', line 80 def ==(i) super or to_int == i end |
#[](index) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ripper/lexer.rb', line 66 def [](index) case index when 0, :to_int @to_int when 1, :to_s @event else nil end end |
#allbits?(i) ⇒ Boolean
83 |
# File 'lib/ripper/lexer.rb', line 83 def allbits?(i) to_int.allbits?(i) end |
#anybits?(i) ⇒ Boolean
84 |
# File 'lib/ripper/lexer.rb', line 84 def anybits?(i) to_int.anybits?(i) end |
#nobits?(i) ⇒ Boolean
85 |
# File 'lib/ripper/lexer.rb', line 85 def nobits?(i) to_int.nobits?(i) end |
#pretty_print(q) ⇒ Object
79 |
# File 'lib/ripper/lexer.rb', line 79 def pretty_print(q) q.text(to_s) end |
#|(i) ⇒ Object
82 |
# File 'lib/ripper/lexer.rb', line 82 def |(i) self.class.new(to_int | i) end |