Class: Utils::IRB::Shell::MethodWrapper
- Inherits:
-
WrapperBase
- Object
- WrapperBase
- Utils::IRB::Shell::MethodWrapper
- Defined in:
- lib/utils/irb.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Attributes inherited from WrapperBase
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #arity ⇒ Object
-
#initialize(obj, name, modul) ⇒ MethodWrapper
constructor
A new instance of MethodWrapper.
- #owner ⇒ Object
- #source_location ⇒ Object
Methods inherited from WrapperBase
Constructor Details
#initialize(obj, name, modul) ⇒ MethodWrapper
Returns a new instance of MethodWrapper.
137 138 139 140 141 |
# File 'lib/utils/irb.rb', line 137 def initialize(obj, name, modul) super(name) @method = modul ? obj.instance_method(name) : obj.method(name) @description = "#{owner}##@name(#{arity})" end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
143 144 145 |
# File 'lib/utils/irb.rb', line 143 def method @method end |
Instance Method Details
#<=>(other) ⇒ Object
157 158 159 |
# File 'lib/utils/irb.rb', line 157 def <=>(other) @description <=> other.description end |
#arity ⇒ Object
149 150 151 |
# File 'lib/utils/irb.rb', line 149 def arity method.arity end |
#owner ⇒ Object
145 146 147 |
# File 'lib/utils/irb.rb', line 145 def owner method.respond_to?(:owner) ? method.owner : nil end |
#source_location ⇒ Object
153 154 155 |
# File 'lib/utils/irb.rb', line 153 def source_location method.source_location end |