Class: HerbTextNode
- Inherits:
-
Object
show all
- Includes:
- TextNode
- Defined in:
- lib/nodes/herb_text_node.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from TextNode
#amount_of_ending_whitespace, #amount_of_starting_whitespace, #contains_alpha_characters?, #extract_text, #has_leading_or_trailing_whitespace?, #has_variables?, #html?, #remove_leading_and_trailing_whitespace, #text?, #top_level?, #white_space?
#flatten
Methods included from BaseNode
#shatter?, #shattered_node_list
Constructor Details
#initialize(text, strip_whitespace = true) ⇒ HerbTextNode
5
6
7
8
|
# File 'lib/nodes/herb_text_node.rb', line 5
def initialize( text, strip_whitespace = true )
@text_value = text
@strip_whitespace = strip_whitespace
end
|
Instance Attribute Details
#text_value ⇒ Object
Returns the value of attribute text_value.
3
4
5
|
# File 'lib/nodes/herb_text_node.rb', line 3
def text_value
@text_value
end
|
Instance Method Details
#can_be_combined? ⇒ Boolean
10
11
12
|
# File 'lib/nodes/herb_text_node.rb', line 10
def can_be_combined?
true
end
|
#node_name ⇒ Object
14
15
16
|
# File 'lib/nodes/herb_text_node.rb', line 14
def node_name
"herb_text_node"
end
|
#strip_whitespace? ⇒ Boolean
18
19
20
|
# File 'lib/nodes/herb_text_node.rb', line 18
def strip_whitespace?
@strip_whitespace
end
|
#to_s ⇒ Object
22
23
24
|
# File 'lib/nodes/herb_text_node.rb', line 22
def to_s
@text_value
end
|