Sha256: 43857c17b8f1e95214733218ca7b341d861bc2199499768965112a59a0caba2a

Contents?: true

Size: 433 Bytes

Versions: 1

Compression:

Stored size: 433 Bytes

Contents

require "active_support"
require "active_support/core_ext/object/blank"

class Code
  class Node
    class Code
      def initialize(statements)
        statements = [] if statements.blank?

        @statements =
          statements.map { |statement| ::Code::Node::Statement.new(statement) }
      end

      def evaluate(context)
        @statements.map { |statement| statement.evaluate(context) }.last
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
template-ruby-0.1.0 lib/code/node/code.rb