Class: Template::Node::Part
- Inherits:
-
Template::Node
- Object
- Code::Node
- Template::Node
- Template::Node::Part
- Defined in:
- lib/template/node/part.rb
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(part) ⇒ Part
constructor
A new instance of Part.
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 |