Class: HerbTextNode

Inherits:
Object
  • Object
show all
Includes:
TextNode
Defined in:
lib/nodes/herb_text_node.rb

Direct Known Subclasses

HerbWhiteSpaceTextNode

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?

Methods included from NodeProcessing

#flatten

Methods included from BaseNode

#shatter?, #shattered_node_list

Constructor Details

#initialize(text, strip_whitespace = true) ⇒ HerbTextNode

Returns a new instance of 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_valueObject

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

Returns:

  • (Boolean)


10
11
12
# File 'lib/nodes/herb_text_node.rb', line 10

def can_be_combined?
  true
end

#node_nameObject



14
15
16
# File 'lib/nodes/herb_text_node.rb', line 14

def node_name
  "herb_text_node"
end

#strip_whitespace?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/nodes/herb_text_node.rb', line 18

def strip_whitespace?
  @strip_whitespace
end

#to_sObject



22
23
24
# File 'lib/nodes/herb_text_node.rb', line 22

def to_s
  @text_value
end