Sha256: 29aaf3c92b093e83c583e5bbee0d4ec2da2c3acdf1659e6662feefbf454677f2

Contents?: true

Size: 648 Bytes

Versions: 12

Compression:

Stored size: 648 Bytes

Contents

class Code
  class Node
    class RegularCallArgument < Node
      def initialize(argument)
        @splat = argument.key?(:splat)
        @keyword_splat = argument.key?(:keyword_splat)
        @block = argument.key?(:block)
        @value = ::Code::Node::Code.new(argument.fetch(:value))
      end

      def evaluate(**args)
        object = @value.evaluate(**args)

        block? ? simple_call(object, :to_function, **args) : object
      end

      def block?
        @block
      end

      def splat?
        @splat
      end

      def keyword_splat?
        @keyword_splat
      end

      def name
        nil
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

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