Class: Code::Node::CallArgument

Inherits:
Code::Node show all
Defined in:
lib/code/node/call_argument.rb

Instance Method Summary collapse

Constructor Details

#initialize(argument) ⇒ CallArgument

Returns a new instance of CallArgument.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/code/node/call_argument.rb', line 4

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

Instance Method Details

#block?Boolean

Returns:



24
25
26
# File 'lib/code/node/call_argument.rb', line 24

def block?
  @argument.block?
end

#evaluate(**args) ⇒ Object



16
17
18
# File 'lib/code/node/call_argument.rb', line 16

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

#keyword_splat?Boolean

Returns:



32
33
34
# File 'lib/code/node/call_argument.rb', line 32

def keyword_splat?
  @argument.keyword_splat?
end

#nameObject



20
21
22
# File 'lib/code/node/call_argument.rb', line 20

def name
  @argument.name
end

#splat?Boolean

Returns:



28
29
30
# File 'lib/code/node/call_argument.rb', line 28

def splat?
  @argument.splat?
end