Sha256: 531c1b373bbe9d0089f847a017e4d1ce3422e68cc48c12897876839e78e6a36d

Contents?: true

Size: 452 Bytes

Versions: 6

Compression:

Stored size: 452 Bytes

Contents

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

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

      def evaluate(**args)
        last = ::Code::Object::Nothing.new

        @statements.each do |statement|
          last = statement.evaluate(**args)
        end

        last
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
template-ruby-0.4.0 lib/code/node/code.rb
code-ruby-0.4.0 lib/code/node/code.rb
template-ruby-0.3.1 lib/code/node/code.rb
code-ruby-0.3.1 lib/code/node/code.rb
template-ruby-0.3.0 lib/code/node/code.rb
code-ruby-0.3.0 lib/code/node/code.rb