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.
4 5 6 7 8 9 10 11 12 |
# File 'lib/template/node/part.rb', line 4 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.new(part.inspect) end end |
Instance Method Details
#evaluate(**args) ⇒ Object
14 15 16 |
# File 'lib/template/node/part.rb', line 14 def evaluate(**args) @part.evaluate(**args) end |