Sha256: 9e31f74221b4347e7aa544c853c14108afd9ec4e8f42d084cf35f6ab868cbe38

Contents?: true

Size: 762 Bytes

Versions: 12

Compression:

Stored size: 762 Bytes

Contents

class Code
  class Node
    class CallArgument < Node
      def initialize(argument)
        if argument.key?(:regular)
          @argument =
            ::Code::Node::RegularCallArgument.new(argument.fetch(:regular))
        elsif argument.key?(:keyword)
          @argument =
            ::Code::Node::KeywordCallArgument.new(argument.fetch(:keyword))
        else
          raise NotImplementedError.new(argument.inspect)
        end
      end

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

      def name
        @argument.name
      end

      def block?
        @argument.block?
      end

      def splat?
        @argument.splat?
      end

      def keyword_splat?
        @argument.keyword_splat?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

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