Class: Oppen::Token::String

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

Overview

String Token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of String.



32
33
34
35
36
# File 'lib/oppen/token.rb', line 32

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

Instance Attribute Details

#valueString (readonly)

Returns String value.

Returns:



28
29
30
# File 'lib/oppen/token.rb', line 28

def value
  @value
end

#widthInteger (readonly)

Returns:

  • (Integer)


30
31
32
# File 'lib/oppen/token.rb', line 30

def width
  @width
end

Instance Method Details

#to_sString

Returns:



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

def to_s = value