Class: Bossy::MethodSignature
- Inherits:
-
Object
- Object
- Bossy::MethodSignature
- Defined in:
- lib/bossy/method_signature.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #args_to_s(args) ⇒ Object
-
#initialize(method_type, method_name, args) ⇒ MethodSignature
constructor
A new instance of MethodSignature.
- #to_s ⇒ Object
Constructor Details
#initialize(method_type, method_name, args) ⇒ MethodSignature
Returns a new instance of MethodSignature.
11 12 13 14 15 16 |
# File 'lib/bossy/method_signature.rb', line 11 def initialize(method_type, method_name, args) @type = method_type @name = method_name @name = @name.to_s if RUBY_VERSION.to_f < 1.9 @args = args end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/bossy/method_signature.rb', line 9 def name @name end |
Instance Method Details
#args_to_s(args) ⇒ Object
22 23 24 |
# File 'lib/bossy/method_signature.rb', line 22 def args_to_s(args) args.map{|nt| "#{nt.first} #{nt.last}"}.join(", ") end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/bossy/method_signature.rb', line 18 def to_s "#{@type} #{@name}(#{args_to_s(@args)})" end |