Class: ArrayNode
- Inherits:
-
SyntaxTree
- Object
- SyntaxTree
- ArrayNode
- Defined in:
- lib/rpdf2txt-rockit/syntax_tree.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#childrens ⇒ Object
readonly
Returns the value of attribute childrens.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from SyntaxTree
Instance Method Summary collapse
- #add_value(value, append = false) ⇒ Object
- #as_a ⇒ Object
- #deep_copy ⇒ Object
-
#initialize(values) ⇒ ArrayNode
constructor
A new instance of ArrayNode.
Methods inherited from SyntaxTree
#==, #[], #compact!, #compact_childrens, #each_breadth_first, #each_node, #inspect_compact, #inspect_multi, #method_missing, #to_graph
Constructor Details
#initialize(values) ⇒ ArrayNode
Returns a new instance of ArrayNode.
425 426 427 |
# File 'lib/rpdf2txt-rockit/syntax_tree.rb', line 425 def initialize(values) super("_ArrayNode", value_names(values), values) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SyntaxTree
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
423 424 425 |
# File 'lib/rpdf2txt-rockit/syntax_tree.rb', line 423 def attributes @attributes end |
#childrens ⇒ Object (readonly)
Returns the value of attribute childrens.
423 424 425 |
# File 'lib/rpdf2txt-rockit/syntax_tree.rb', line 423 def childrens @childrens end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
423 424 425 |
# File 'lib/rpdf2txt-rockit/syntax_tree.rb', line 423 def name @name end |
Instance Method Details
#add_value(value, append = false) ⇒ Object
437 438 439 440 441 442 443 444 445 |
# File 'lib/rpdf2txt-rockit/syntax_tree.rb', line 437 def add_value(value, append = false) if append @childrens.push value @children_names.push "c#{@childrens.length}" else @childrens.unshift value @children_names.unshift "c#{@childrens.length}" end end |
#as_a ⇒ Object
433 434 435 |
# File 'lib/rpdf2txt-rockit/syntax_tree.rb', line 433 def as_a @childrens end |