Class: HerbNodeRetainingNonTextNode
Class Method Summary
collapse
Instance Method Summary
collapse
#contains_only_whitespace?, #extract_text, #text?, #top_level?, #white_space?
Methods included from BaseNode
#shatter?, #shattered_node_list
#nodes, #text_value
Constructor Details
4
5
6
7
|
# File 'lib/nodes/herb_node_retaining_non_text_node.rb', line 4
def initialize( first_node = nil )
super( first_node )
@can_be_combined = false
end
|
Class Method Details
.create_from_nodes(nodes) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/nodes/herb_node_retaining_non_text_node.rb', line 18
def self.create_from_nodes( nodes )
to_return = HerbNodeRetainingNonTextNode.new
nodes.each do |node|
to_return << node
end
to_return
end
|
Instance Method Details
#<<(node) ⇒ Object
9
10
11
12
|
# File 'lib/nodes/herb_node_retaining_non_text_node.rb', line 9
def <<(node)
super(node)
@can_be_combined ||= ( node.respond_to?( :can_be_combined? ) && node.can_be_combined? )
end
|
#can_be_combined? ⇒ Boolean
14
15
16
|
# File 'lib/nodes/herb_node_retaining_non_text_node.rb', line 14
def can_be_combined?
@can_be_combined
end
|