Class: TokenParser::Marker
Overview
Token Marker
This is the superclas of Token, UnitToken and RawToken
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#inner_range ⇒ Object
Returns the value of attribute inner_range.
-
#match ⇒ Object
Returns the value of attribute match.
-
#outer_range ⇒ Object
Returns the value of attribute outer_range.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#<<(content) ⇒ Object
array-like methods.
- #each(&blk) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ Marker
constructor
A new instance of Marker.
- #last ⇒ Object
- #pop ⇒ Object
Constructor Details
#initialize ⇒ Marker
Returns a new instance of Marker.
152 153 154 |
# File 'lib/mega/tokenparser.rb', line 152 def initialize @content = [] end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
150 151 152 |
# File 'lib/mega/tokenparser.rb', line 150 def content @content end |
#inner_range ⇒ Object
Returns the value of attribute inner_range.
151 152 153 |
# File 'lib/mega/tokenparser.rb', line 151 def inner_range @inner_range end |
#match ⇒ Object
Returns the value of attribute match.
150 151 152 |
# File 'lib/mega/tokenparser.rb', line 150 def match @match end |
#outer_range ⇒ Object
Returns the value of attribute outer_range.
151 152 153 |
# File 'lib/mega/tokenparser.rb', line 151 def outer_range @outer_range end |
#parent ⇒ Object
Returns the value of attribute parent.
150 151 152 |
# File 'lib/mega/tokenparser.rb', line 150 def parent @parent end |
#token ⇒ Object
Returns the value of attribute token.
150 151 152 |
# File 'lib/mega/tokenparser.rb', line 150 def token @token end |
Instance Method Details
#<<(content) ⇒ Object
array-like methods
156 |
# File 'lib/mega/tokenparser.rb', line 156 def <<( content ) ; @content << content ; end |
#each(&blk) ⇒ Object
160 |
# File 'lib/mega/tokenparser.rb', line 160 def each(&blk) ; @content.each(&blk) ; end |
#empty? ⇒ Boolean
158 |
# File 'lib/mega/tokenparser.rb', line 158 def empty? ; @content.empty? ; end |
#last ⇒ Object
157 |
# File 'lib/mega/tokenparser.rb', line 157 def last ; @content.empty? ? @content : @content.last ; end |
#pop ⇒ Object
159 |
# File 'lib/mega/tokenparser.rb', line 159 def pop ; @content.pop ; end |