Class: Fastererer::MethodCall
- Inherits:
-
Object
- Object
- Fastererer::MethodCall
- Defined in:
- lib/fastererer/method_call.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#block_argument_names ⇒ Object
readonly
Returns the value of attribute block_argument_names.
-
#block_body ⇒ Object
readonly
Returns the value of attribute block_body.
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#method_name ⇒ Object
(also: #name)
readonly
Returns the value of attribute method_name.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Instance Method Summary collapse
- #arguments_element ⇒ Object
- #block? ⇒ Boolean
-
#initialize(element) ⇒ MethodCall
constructor
A new instance of MethodCall.
- #lambda_literal? ⇒ Boolean
- #receiver_element ⇒ Object
Constructor Details
#initialize(element) ⇒ MethodCall
Returns a new instance of MethodCall.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fastererer/method_call.rb', line 9 def initialize(element) @element = element set_call_element set_receiver set_method_name set_arguments set_block_presence set_block_body set_block_argument_names end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
5 6 7 |
# File 'lib/fastererer/method_call.rb', line 5 def arguments @arguments end |
#block_argument_names ⇒ Object (readonly)
Returns the value of attribute block_argument_names.
5 6 7 |
# File 'lib/fastererer/method_call.rb', line 5 def block_argument_names @block_argument_names end |
#block_body ⇒ Object (readonly)
Returns the value of attribute block_body.
5 6 7 |
# File 'lib/fastererer/method_call.rb', line 5 def block_body @block_body end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
5 6 7 |
# File 'lib/fastererer/method_call.rb', line 5 def element @element end |
#method_name ⇒ Object (readonly) Also known as: name
Returns the value of attribute method_name.
5 6 7 |
# File 'lib/fastererer/method_call.rb', line 5 def method_name @method_name end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
5 6 7 |
# File 'lib/fastererer/method_call.rb', line 5 def receiver @receiver end |
Instance Method Details
#arguments_element ⇒ Object
28 29 30 |
# File 'lib/fastererer/method_call.rb', line 28 def arguments_element call_element.sexp_body(3) || [] end |
#block? ⇒ Boolean
20 21 22 |
# File 'lib/fastererer/method_call.rb', line 20 def block? @block_present || false end |
#lambda_literal? ⇒ Boolean
32 33 34 |
# File 'lib/fastererer/method_call.rb', line 32 def lambda_literal? call_element.sexp_type == :lambda end |
#receiver_element ⇒ Object
24 25 26 |
# File 'lib/fastererer/method_call.rb', line 24 def receiver_element call_element[1] end |