Class: Stupidedi::Reader::SimpleElementTok
- Inherits:
-
Object
- Object
- Stupidedi::Reader::SimpleElementTok
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/reader/tokens/simple_element_tok.rb
Instance Attribute Summary collapse
- #position ⇒ Position readonly
- #remainder ⇒ Position readonly
- #value ⇒ String, Object readonly
Constructors collapse
Instance Method Summary collapse
- #blank? ⇒ Boolean
- #composite? ⇒ Boolean
-
#initialize(value, position, remainder) ⇒ SimpleElementTok
constructor
A new instance of SimpleElementTok.
- #present? ⇒ Boolean
- #pretty_print(q) ⇒ Object
- #repeated ⇒ Object
- #repeated? ⇒ Boolean
- #simple? ⇒ Boolean
Methods included from Inspect
Constructor Details
#initialize(value, position, remainder) ⇒ SimpleElementTok
Returns a new instance of SimpleElementTok.
19 20 21 22 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 19 def initialize(value, position, remainder) @value, @position, @remainder = value, position, remainder end |
Instance Attribute Details
#position ⇒ Position (readonly)
14 15 16 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 14 def position @position end |
#remainder ⇒ Position (readonly)
17 18 19 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 17 def remainder @remainder end |
#value ⇒ String, Object (readonly)
11 12 13 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 11 def value @value end |
Class Method Details
.build(value, position, remainder) ⇒ Object
57 58 59 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 57 def build(value, position, remainder) new(value, position, remainder) end |
Instance Method Details
#blank? ⇒ Boolean
36 37 38 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 36 def blank? @value.blank? end |
#composite? ⇒ Boolean
48 49 50 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 48 def composite? false end |
#present? ⇒ Boolean
40 41 42 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 40 def present? not blank? end |
#pretty_print(q) ⇒ Object
24 25 26 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 24 def pretty_print(q) q.pp(:simple.cons(@value.cons)) end |
#repeated ⇒ Object
28 29 30 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 28 def repeated RepeatedElementTok.new(self.cons, @position) end |
#repeated? ⇒ Boolean
32 33 34 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 32 def repeated? false end |
#simple? ⇒ Boolean
44 45 46 |
# File 'lib/stupidedi/reader/tokens/simple_element_tok.rb', line 44 def simple? true end |