Class: TokenParser::UnitToken

Inherits:
Object
  • Object
show all
Defined in:
lib/mega/tokenparser.rb

Overview

Unit Token Definition Class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, start = nil) ⇒ UnitToken

Returns a new instance of UnitToken.



362
363
364
365
# File 'lib/mega/tokenparser.rb', line 362

def initialize( key, start=nil )
  @key = key
  @start = start
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



359
360
361
# File 'lib/mega/tokenparser.rb', line 359

def key
  @key
end

#parserObject

Returns the value of attribute parser.



360
361
362
# File 'lib/mega/tokenparser.rb', line 360

def parser
  @parser
end

#start(match = nil) ⇒ Object

def raw? ; @type == :raw ; end def normal? ; @type != :raw && @type != :unit ; end



371
372
373
# File 'lib/mega/tokenparser.rb', line 371

def start
  @start
end

#typeObject (readonly)

Returns the value of attribute type.



359
360
361
# File 'lib/mega/tokenparser.rb', line 359

def type
  @type
end

Instance Method Details

#unit?Boolean

Returns:

  • (Boolean)


367
# File 'lib/mega/tokenparser.rb', line 367

def unit? ; true  ; end