Module: NonTextNode

Includes:
BaseNode
Included in:
ErbStringNonTextContent, HerbNodeRetainingNonTextNode, HerbNonTextNode, NonExtractingNonTextNode
Defined in:
lib/core/non_text_node.rb

Instance Method Summary collapse

Methods included from BaseNode

#shatter?, #shattered_node_list

Instance Method Details

#can_be_combined?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/core/non_text_node.rb', line 3

def can_be_combined?
  false
end

#contains_only_whitespace?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/core/non_text_node.rb', line 16

def contains_only_whitespace?
  self.text_value.strip.length == 0
end

#extract_text(text_extractor, node_tree) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/core/non_text_node.rb', line 7

def extract_text( text_extractor, node_tree )
  if( self.white_space? )
    text_extractor.white_space( self )
  else
    text_extractor.add_non_text( self ) unless self.contains_only_whitespace?
  end
  
end

#text?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/core/non_text_node.rb', line 20

def text?
  false
end

#top_level?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/core/non_text_node.rb', line 24

def top_level?
  true
end

#white_space?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/core/non_text_node.rb', line 28

def white_space?
  false
end