Class: OperatorElement
- Defined in:
- lib/rpdf2txt-rockit/grammar.rb
Direct Known Subclasses
ListElement, MaybeElement, MultElement, OrElement, PlusElement
Instance Attribute Summary collapse
-
#sub_elements ⇒ Object
readonly
Returns the value of attribute sub_elements.
Attributes inherited from Element
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(subElements, *rest) ⇒ OperatorElement
constructor
A new instance of OperatorElement.
- #name ⇒ Object
- #to_src(name = nil, nameHash = {}) ⇒ Object
Methods inherited from Element
Methods included from SourceCodeDumpable
as_code, as_method_named, as_module_method_named, #create_new, indent_lines, name_hash, #new_of_my_type, #parameter_named, #to_compact_src, #to_src_in_module, #type_to_src
Constructor Details
#initialize(subElements, *rest) ⇒ OperatorElement
Returns a new instance of OperatorElement.
98 99 100 |
# File 'lib/rpdf2txt-rockit/grammar.rb', line 98 def initialize(subElements, *rest) @sub_elements = make_elements(subElements, rest) end |
Instance Attribute Details
#sub_elements ⇒ Object (readonly)
Returns the value of attribute sub_elements.
96 97 98 |
# File 'lib/rpdf2txt-rockit/grammar.rb', line 96 def sub_elements @sub_elements end |
Instance Method Details
#==(other) ⇒ Object
111 112 113 |
# File 'lib/rpdf2txt-rockit/grammar.rb', line 111 def ==(other) other.class == self.class and other.sub_elements == @sub_elements end |
#name ⇒ Object
102 103 104 |
# File 'lib/rpdf2txt-rockit/grammar.rb', line 102 def name type_to_src.split("Element").first end |
#to_src(name = nil, nameHash = {}) ⇒ Object
106 107 108 109 |
# File 'lib/rpdf2txt-rockit/grammar.rb', line 106 def to_src(name = nil, nameHash = {}) assign_to(name, new_of_my_type(as_code(@sub_elements.to_src(nil,nameHash)))) end |