Class: Oppen::Token::String

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

Overview

String Token.

Direct Known Subclasses

Whitespace

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, width: value.length) ⇒ String

Returns a new instance of String.



19
20
21
22
23
# File 'lib/oppen/token.rb', line 19

def initialize(value, width: value.length)
  @value = value
  @width = width
  super()
end

Instance Attribute Details

#valueString (readonly)

Returns:



15
16
17
# File 'lib/oppen/token.rb', line 15

def value
  @value
end

#widthInteger (readonly)

Returns:

  • (Integer)


17
18
19
# File 'lib/oppen/token.rb', line 17

def width
  @width
end

Instance Method Details

#to_sString

Returns:



26
# File 'lib/oppen/token.rb', line 26

def to_s = value