Class: LXL::Parser::Token
- Inherits:
-
Object
- Object
- LXL::Parser::Token
- Defined in:
- lib/lxl.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object (also: #inspect)
- #whitespace? ⇒ Boolean
Constructor Details
#initialize(type, value) ⇒ Token
Returns a new instance of Token.
188 |
# File 'lib/lxl.rb', line 188 def initialize(type, value) @type = type; @value = value end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
187 188 189 |
# File 'lib/lxl.rb', line 187 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
187 188 189 |
# File 'lib/lxl.rb', line 187 def value @value end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
190 |
# File 'lib/lxl.rb', line 190 def to_s() "T:#{@type.chr}:#{@value}" end |
#whitespace? ⇒ Boolean
189 |
# File 'lib/lxl.rb', line 189 def whitespace?() value.to_s.strip.empty? end |