Class: FlavourSaver::BlockExpressionNodeWithElse

Inherits:
BlockExpressionNode show all
Defined in:
lib/flavour_saver/nodes.rb

Instance Method Summary collapse

Methods inherited from BlockExpressionNode

#name

Instance Method Details

#inspectObject



142
143
144
145
146
147
148
# File 'lib/flavour_saver/nodes.rb', line 142

def inspect
  r = "{{##{method.map(&:to_s).join ''}}}\n"
  r << contents.inspect.split("\n").join("\n  ")
  r << "\n  {{else}}\n"
  r << alternate.inspect.split("\n").join("\n  ")
  r
end

#to_sObject



138
139
140
# File 'lib/flavour_saver/nodes.rb', line 138

def to_s
  "{{##{method.map(&:to_s).join ''}}}#{contents.to_s}{{else}}#{alternate.to_s}{{/#{closer.name}}}"
end