Class: MethodSig::Signature
- Inherits:
-
Object
- Object
- MethodSig::Signature
- Defined in:
- lib/decompiler/method/signature/signature.rb
Overview
An abstraction for a method signature.
Instance Attribute Summary collapse
-
#arg_names ⇒ Object
readonly
Returns the value of attribute arg_names.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#origin_class ⇒ Object
readonly
Returns the value of attribute origin_class.
Instance Method Summary collapse
-
#initialize(origin_class, name, arg_names, args) ⇒ Signature
constructor
A new instance of Signature.
- #param_list ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(origin_class, name, arg_names, args) ⇒ Signature
Returns a new instance of Signature.
6 7 8 9 10 11 |
# File 'lib/decompiler/method/signature/signature.rb', line 6 def initialize(origin_class, name, arg_names, args) @origin_class = origin_class @name = name @arg_names = arg_names @args = args end |
Instance Attribute Details
#arg_names ⇒ Object (readonly)
Returns the value of attribute arg_names.
4 5 6 |
# File 'lib/decompiler/method/signature/signature.rb', line 4 def arg_names @arg_names end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/decompiler/method/signature/signature.rb', line 4 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/decompiler/method/signature/signature.rb', line 4 def name @name end |
#origin_class ⇒ Object (readonly)
Returns the value of attribute origin_class.
4 5 6 |
# File 'lib/decompiler/method/signature/signature.rb', line 4 def origin_class @origin_class end |
Instance Method Details
#param_list ⇒ Object
17 18 19 20 |
# File 'lib/decompiler/method/signature/signature.rb', line 17 def param_list params = @arg_names.map{ |n| args[n].to_s } return params.join(', ') end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/decompiler/method/signature/signature.rb', line 13 def to_s return "#{@origin_class}\##{@name}(#{param_list})" end |