Module: PluralizeNode

Includes:
TextNode
Defined in:
lib/core/pluralize_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?, #has_leading_or_trailing_whitespace?, #has_variables?, #html?, #remove_leading_and_trailing_whitespace, #strip_whitespace?, #text?, #top_level?, #white_space?

Methods included from NodeProcessing

#flatten

Methods included from BaseNode

#shatter?, #shattered_node_list

Instance Attribute Details

#variable_nameObject (readonly)

Returns the value of attribute variable_name.



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

def variable_name
  @variable_name
end

#variable_valueObject (readonly)

Returns the value of attribute variable_value.



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

def variable_value
  @variable_value
end

Instance Method Details

#extract_text(text_extractor, node_tree, surrounding_nodes = nil) ⇒ Object



5
6
7
8
9
# File 'lib/core/pluralize_node.rb', line 5

def extract_text( text_extractor, node_tree, surrounding_nodes = nil )
  set_variable_name_and_value( text_extractor, node_tree, surrounding_nodes )
  variable_name = I18nKey.new( self.repetition.text_value, get_key_hash(text_extractor, node_tree) ).to_s      
  text_extractor.pluralize( self, variable_name )
end