Class: Code::Node::CallArgument
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::CallArgument
- Defined in:
- lib/code/node/call_argument.rb
Instance Method Summary collapse
- #block? ⇒ Boolean
- #evaluate(**args) ⇒ Object
-
#initialize(argument) ⇒ CallArgument
constructor
A new instance of CallArgument.
- #keyword_splat? ⇒ Boolean
- #name ⇒ Object
- #splat? ⇒ Boolean
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
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
32 33 34 |
# File 'lib/code/node/call_argument.rb', line 32 def keyword_splat? @argument.keyword_splat? end |
#name ⇒ Object
20 21 22 |
# File 'lib/code/node/call_argument.rb', line 20 def name @argument.name end |
#splat? ⇒ Boolean
28 29 30 |
# File 'lib/code/node/call_argument.rb', line 28 def splat? @argument.splat? end |