Class: XRT::Statement::Document
Instance Method Summary
collapse
#auto_indent, #contains_directive?, #depth, #find_block_texts, #find_blocks, #find_blocks_with_directive, #include?, #replace_child, #statements
Constructor Details
Returns a new instance of Document.
121
122
123
|
# File 'lib/xrt/statement.rb', line 121
def initialize
@children = []
end
|
Instance Method Details
#<<(statement) ⇒ Object
125
126
127
|
# File 'lib/xrt/statement.rb', line 125
def << statement
@children << statement
end
|
#==(other) ⇒ Object
137
138
139
|
# File 'lib/xrt/statement.rb', line 137
def == other
self.content == other.content && self.children.zip(other.children).all{|a, b| p [a, b]; a == b }
end
|
#children ⇒ Object
129
130
131
|
# File 'lib/xrt/statement.rb', line 129
def children
@children
end
|
#content ⇒ Object
133
134
135
|
# File 'lib/xrt/statement.rb', line 133
def content
children.map{|c| c.content }.join
end
|
#inspect ⇒ Object
141
142
143
|
# File 'lib/xrt/statement.rb', line 141
def inspect
"(#{self.class}:#{self.children})"
end
|