Class: Decode::Language::Ruby::Method
- Inherits:
-
Definition
- Object
- Symbol
- Definition
- Decode::Language::Ruby::Method
- Defined in:
- lib/decode/language/ruby/method.rb
Overview
A Ruby-specific method.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Definition
Attributes inherited from Symbol
#kind, #language, #name, #parent
Instance Method Summary collapse
-
#arguments_node ⇒ Object
The node which contains the function arguments.
-
#long_form ⇒ Object
The long form of the method.
-
#short_form ⇒ Object
The short form of the method.
Methods inherited from Definition
#container?, #documentation, #initialize, #multiline?, #nested?, #qualified_form, #text
Methods inherited from Symbol
#initialize, #inspect, #key, #lexical_path, #path, #qualified_name
Constructor Details
This class inherits a constructor from Decode::Definition
Instance Method Details
#arguments_node ⇒ Object
The node which contains the function arguments.
35 36 37 38 39 40 41 |
# File 'lib/decode/language/ruby/method.rb', line 35 def arguments_node if node = @node.children[1] if node.location.expression return node end end end |
#long_form ⇒ Object
The long form of the method. e.g. ‘def puts(*lines, separator: “n”)`.
45 46 47 48 49 50 51 52 53 |
# File 'lib/decode/language/ruby/method.rb', line 45 def long_form if arguments_node = self.arguments_node @node.location.keyword.join( arguments_node.location.expression ).source else self.short_form end end |
#short_form ⇒ Object
The short form of the method. e.g. ‘def puts`.
30 31 32 |
# File 'lib/decode/language/ruby/method.rb', line 30 def short_form @node.location.keyword.join(@node.location.name).source end |