Sha256: 472fa50e895f9b564f01096b862c70ac9b758673497c5bf1a30ccebe7365c70a

Contents?: true

Size: 439 Bytes

Versions: 12

Compression:

Stored size: 439 Bytes

Contents

class Code
  class Node
    class Function < Node
      def initialize(function)
        @body = ::Code::Node::Code.new(function.fetch(:body))
        @arguments = function.fetch(:arguments, [])
        @arguments.map! do |argument|
          ::Code::Node::FunctionArgument.new(argument)
        end
      end

      def evaluate(**args)
        ::Code::Object::Function.new(arguments: @arguments, body: @body)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
template-ruby-0.4.0 lib/code/node/function.rb
code-ruby-0.4.0 lib/code/node/function.rb
template-ruby-0.3.1 lib/code/node/function.rb
code-ruby-0.3.1 lib/code/node/function.rb
template-ruby-0.3.0 lib/code/node/function.rb
code-ruby-0.3.0 lib/code/node/function.rb
code-ruby-0.2.4 lib/code/node/function.rb
template-ruby-0.2.4 lib/code/node/function.rb
template-ruby-0.2.3 lib/code/node/function.rb
template-ruby-0.2.2 lib/code/node/function.rb
template-ruby-0.2.1 lib/code/node/function.rb
template-ruby-0.2.0 lib/code/node/function.rb