Class: OperatorElement

Inherits:
Element show all
Defined in:
lib/rpdf2txt-rockit/grammar.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#tree_specification

Instance Method Summary collapse

Methods inherited from Element

#normalize

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_elementsObject (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

#nameObject



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