Sha256: 045c80e1f92cd0f21f19cf3405d6fc94de77a9ddb2e0b30cea55347ee5124c0f

Contents?: true

Size: 463 Bytes

Versions: 12

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

class Template
  class Node
    class Part < Node
      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

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
template-ruby-1.1.2 lib/template/node/part.rb
template-ruby-1.1.0 lib/template/node/part.rb
template-ruby-1.0.0 lib/template/node/part.rb
template-ruby-0.7.3 lib/template/node/part.rb
template-ruby-0.7.2 lib/template/node/part.rb
template-ruby-0.7.0 lib/template/node/part.rb
template-ruby-0.6.9 lib/template/node/part.rb
template-ruby-0.6.8 lib/template/node/part.rb
template-ruby-0.6.7 lib/template/node/part.rb
template-ruby-0.6.6 lib/template/node/part.rb
template-ruby-0.6.5 lib/template/node/part.rb
template-ruby-0.6.4 lib/template/node/part.rb