Class: Template::Node::Part

Inherits:
Template::Node show all
Defined in:
lib/template/node/part.rb

Instance Method Summary collapse

Constructor Details

#initialize(part) ⇒ Part

Returns a new instance of Part.



6
7
8
9
10
11
12
13
14
# File 'lib/template/node/part.rb', line 6

def initialize(part)
  if part.key?(:text)
    @part = ::Template::Node::TextPart.new(part[:text])
  elsif part.key?(:code)
    @part = ::Template::Node::CodePart.new(part[:code])
  else
    raise NotImplementedError, part.inspect
  end
end

Instance Method Details

#evaluate(**args) ⇒ Object



16
17
18
# File 'lib/template/node/part.rb', line 16

def evaluate(**args)
  @part.evaluate(**args)
end