Class: TokenParser::Token
Overview
Token Definition Class
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#parser ⇒ Object
Returns the value of attribute parser.
-
#start(match = nil) ⇒ Object
def raw? ; @type == :raw ; end def normal? ; @type != :raw && @type != :unit ; end.
-
#stop(match = nil) ⇒ Object
Returns the value of attribute stop.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(key, start = nil, stop = nil) ⇒ Token
constructor
A new instance of Token.
- #unit? ⇒ Boolean
Constructor Details
#initialize(key, start = nil, stop = nil) ⇒ Token
Returns a new instance of Token.
332 333 334 335 336 |
# File 'lib/mega/tokenparser.rb', line 332 def initialize( key, start=nil, stop=nil ) @key = key @start = start @stop = stop end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
329 330 331 |
# File 'lib/mega/tokenparser.rb', line 329 def key @key end |
#parser ⇒ Object
Returns the value of attribute parser.
330 331 332 |
# File 'lib/mega/tokenparser.rb', line 330 def parser @parser end |
#start(match = nil) ⇒ Object
def raw? ; @type == :raw ; end def normal? ; @type != :raw && @type != :unit ; end
342 343 344 |
# File 'lib/mega/tokenparser.rb', line 342 def start @start end |
#stop(match = nil) ⇒ Object
Returns the value of attribute stop.
330 331 332 |
# File 'lib/mega/tokenparser.rb', line 330 def stop @stop end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
329 330 331 |
# File 'lib/mega/tokenparser.rb', line 329 def type @type end |
Instance Method Details
#unit? ⇒ Boolean
338 |
# File 'lib/mega/tokenparser.rb', line 338 def unit? ; false ; end |