Class: RailsTextVariableNode

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

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, #strip_whitespace?, #text?, #top_level?, #white_space?

Methods included from NodeProcessing

#flatten

Methods included from BaseNode

#shatter?, #shattered_node_list

Constructor Details

#initialize(key, value) ⇒ RailsTextVariableNode

Returns a new instance of RailsTextVariableNode.



4
5
6
7
# File 'lib/nodes/rails_text_variable_node.rb', line 4

def initialize( key, value )
  @key = key
  @value = value
end

Instance Method Details

#text_valueObject



9
10
11
# File 'lib/nodes/rails_text_variable_node.rb', line 9

def text_value
  "%{#{@key}}"
end

#to_sObject



13
14
15
# File 'lib/nodes/rails_text_variable_node.rb', line 13

def to_s
  ":#{@key} => (#{@value})"
end