Class: Wukong::FlatPack::Tokens::BasicToken

Inherits:
Token
  • Object
show all
Defined in:
lib/wukong/model/flatpack_parser/tokens.rb

Direct Known Subclasses

BoolToken, FloatToken, IgnoreToken, IntToken, StringToken

Instance Attribute Summary collapse

Attributes inherited from Token

#indicator, #length, #position

Instance Method Summary collapse

Methods inherited from Token

indicator=

Instance Attribute Details

#modifierObject

Returns the value of attribute modifier.



40
41
42
# File 'lib/wukong/model/flatpack_parser/tokens.rb', line 40

def modifier
  @modifier
end

Instance Method Details

#re(token = '.') ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/wukong/model/flatpack_parser/tokens.rb', line 42

def re token= '.'
  if not @length.nil?
    return "#{token}{#{@length}}"
  elsif not @modifier.nil?
    return "#{token}#{@modifier}"
  else
    return token
  end
end