Class: Stupidedi::Reader::CompositeElementTok
- Inherits:
-
Object
- Object
- Stupidedi::Reader::CompositeElementTok
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/reader/tokens/composite_element_tok.rb
Instance Attribute Summary collapse
- #component_toks ⇒ Array<ComponentElementTok> readonly
- #position ⇒ Position readonly
- #remainder ⇒ Position readonly
Constructors collapse
Instance Method Summary collapse
- #blank? ⇒ Boolean
- #composite? ⇒ Boolean
-
#initialize(component_toks, position, remainder) ⇒ CompositeElementTok
constructor
A new instance of CompositeElementTok.
- #present? ⇒ Boolean
- #pretty_print(q) ⇒ Object
- #repeated ⇒ Object
- #repeated? ⇒ Boolean
- #simple? ⇒ Boolean
Methods included from Inspect
Constructor Details
#initialize(component_toks, position, remainder) ⇒ CompositeElementTok
Returns a new instance of CompositeElementTok.
18 19 20 21 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 18 def initialize(component_toks, position, remainder) @component_toks, @position, @remainder = component_toks, position, remainder end |
Instance Attribute Details
#component_toks ⇒ Array<ComponentElementTok> (readonly)
10 11 12 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 10 def component_toks @component_toks end |
#position ⇒ Position (readonly)
13 14 15 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 13 def position @position end |
#remainder ⇒ Position (readonly)
16 17 18 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 16 def remainder @remainder end |
Class Method Details
.build(component_toks, position, remainder) ⇒ CompositeElementTok
57 58 59 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 57 def build(component_toks, position, remainder) new(component_toks, position, remainder) end |
Instance Method Details
#blank? ⇒ Boolean
35 36 37 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 35 def blank? @component_toks.all?(&:blank?) end |
#composite? ⇒ Boolean
47 48 49 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 47 def composite? true end |
#present? ⇒ Boolean
39 40 41 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 39 def present? not blank? end |
#pretty_print(q) ⇒ Object
23 24 25 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 23 def pretty_print(q) q.pp(:composite.cons(@component_toks)) end |
#repeated ⇒ Object
27 28 29 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 27 def repeated RepeatedElementTok.new(self.cons, @position) end |
#repeated? ⇒ Boolean
31 32 33 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 31 def repeated? false end |
#simple? ⇒ Boolean
43 44 45 |
# File 'lib/stupidedi/reader/tokens/composite_element_tok.rb', line 43 def simple? false end |