Class: Ripper::Lexer::State

Inherits:
Struct
  • Object
show all
Defined in:
lib/ripper/lexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(i) ⇒ State

Returns a new instance of State.


58
# File 'lib/ripper/lexer.rb', line 58

def initialize(i) super(i, Ripper.lex_state_name(i)).freeze end

Instance Attribute Details

#to_intObject Also known as: to_i

Returns the value of attribute to_int

Returns:

  • (Object)

    the current value of to_int


56
57
58
# File 'lib/ripper/lexer.rb', line 56

def to_int
  @to_int
end

#to_sObject Also known as: inspect

Returns the value of attribute to_s

Returns:

  • (Object)

    the current value of to_s


56
57
58
# File 'lib/ripper/lexer.rb', line 56

def to_s
  @to_s
end

Instance Method Details

#&(i) ⇒ Object


63
# File 'lib/ripper/lexer.rb', line 63

def &(i) self.class.new(to_int & i) end

#==(i) ⇒ Object


62
# File 'lib/ripper/lexer.rb', line 62

def ==(i) super or to_int == i end

#allbits?(i) ⇒ Boolean

Returns:

  • (Boolean)

65
# File 'lib/ripper/lexer.rb', line 65

def allbits?(i) to_int.allbits?(i) end

#anybits?(i) ⇒ Boolean

Returns:

  • (Boolean)

66
# File 'lib/ripper/lexer.rb', line 66

def anybits?(i) to_int.anybits?(i) end

#nobits?(i) ⇒ Boolean

Returns:

  • (Boolean)

67
# File 'lib/ripper/lexer.rb', line 67

def nobits?(i) to_int.nobits?(i) end

#pretty_print(q) ⇒ Object


61
# File 'lib/ripper/lexer.rb', line 61

def pretty_print(q) q.text(to_s) end

#|(i) ⇒ Object


64
# File 'lib/ripper/lexer.rb', line 64

def |(i) self.class.new(to_int | i) end