Class: Oppen::Token::Begin

Inherits:
Oppen::Token show all
Defined in:
lib/oppen/token.rb

Overview

Begin Token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Oppen::Token

#width

Constructor Details

#initialize(break_type: BreakType::INCONSISTENT, offset: 2) ⇒ Begin

Returns a new instance of Begin.



93
94
95
96
97
# File 'lib/oppen/token.rb', line 93

def initialize(break_type: BreakType::INCONSISTENT, offset: 2)
  @offset = offset
  @break_type = break_type
  super()
end

Instance Attribute Details

#break_typeBreakType (readonly)

Returns:



89
90
91
# File 'lib/oppen/token.rb', line 89

def break_type
  @break_type
end

#offsetInteger (readonly)

Returns Indentation.

Returns:

  • (Integer)

    Indentation.



91
92
93
# File 'lib/oppen/token.rb', line 91

def offset
  @offset
end

Instance Method Details

#break_type_nameString

The break_type name as a String.

Returns:



102
103
104
105
106
107
108
# File 'lib/oppen/token.rb', line 102

def break_type_name
  case @break_type
  in BreakType::FITS         then 'Oppen::Token::BreakType::FITS'
  in BreakType::INCONSISTENT then 'Oppen::Token::BreakType::INCONSISTENT'
  in BreakType::CONSISTENT   then 'Oppen::Token::BreakType::CONSISTENT'
  end
end