Class: Fasterer::MethodCall
- Inherits:
-
Object
- Object
- Fasterer::MethodCall
- Defined in:
- lib/fasterer/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
- #has_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.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fasterer/method_call.rb', line 12 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.
6 7 8 |
# File 'lib/fasterer/method_call.rb', line 6 def arguments @arguments end |
#block_argument_names ⇒ Object (readonly)
Returns the value of attribute block_argument_names.
8 9 10 |
# File 'lib/fasterer/method_call.rb', line 8 def block_argument_names @block_argument_names end |
#block_body ⇒ Object (readonly)
Returns the value of attribute block_body.
7 8 9 |
# File 'lib/fasterer/method_call.rb', line 7 def block_body @block_body end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
3 4 5 |
# File 'lib/fasterer/method_call.rb', line 3 def element @element end |
#method_name ⇒ Object (readonly) Also known as: name
Returns the value of attribute method_name.
5 6 7 |
# File 'lib/fasterer/method_call.rb', line 5 def method_name @method_name end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
4 5 6 |
# File 'lib/fasterer/method_call.rb', line 4 def receiver @receiver end |
Instance Method Details
#arguments_element ⇒ Object
31 32 33 |
# File 'lib/fasterer/method_call.rb', line 31 def arguments_element call_element.sexp_body(3) || [] end |
#has_block? ⇒ Boolean
23 24 25 |
# File 'lib/fasterer/method_call.rb', line 23 def has_block? @block_present || false end |
#lambda_literal? ⇒ Boolean
35 36 37 |
# File 'lib/fasterer/method_call.rb', line 35 def lambda_literal? call_element.sexp_type == :lambda end |
#receiver_element ⇒ Object
27 28 29 |
# File 'lib/fasterer/method_call.rb', line 27 def receiver_element call_element[1] end |