Class: Code::Node::KeywordCallArgument

Inherits:
Code::Node
  • Object
show all
Defined in:
lib/code/node/keyword_call_argument.rb

Instance Method Summary collapse

Constructor Details

#initialize(argument) ⇒ KeywordCallArgument

Returns a new instance of KeywordCallArgument.



4
5
6
7
# File 'lib/code/node/keyword_call_argument.rb', line 4

def initialize(argument)
  @name = argument.fetch(:name)
  @value = ::Code::Node::Code.new(argument.fetch(:value))
end

Instance Method Details

#block?Boolean

Returns:



17
18
19
# File 'lib/code/node/keyword_call_argument.rb', line 17

def block?
  false
end

#evaluate(**args) ⇒ Object



9
10
11
# File 'lib/code/node/keyword_call_argument.rb', line 9

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

#keyword_splat?Boolean

Returns:



25
26
27
# File 'lib/code/node/keyword_call_argument.rb', line 25

def keyword_splat?
  false
end

#nameObject



13
14
15
# File 'lib/code/node/keyword_call_argument.rb', line 13

def name
  ::Code::Object::String.new(@name.to_s)
end

#splat?Boolean

Returns:



21
22
23
# File 'lib/code/node/keyword_call_argument.rb', line 21

def splat?
  false
end