Class: Laplus::Helper::MethodHelper
- Inherits:
-
Object
- Object
- Laplus::Helper::MethodHelper
- Defined in:
- lib/laplus/helper/method_helper.rb
Instance Method Summary collapse
- #alias? ⇒ Boolean
-
#initialize(_method) ⇒ MethodHelper
constructor
A new instance of MethodHelper.
- #owner_singleton? ⇒ Boolean
- #singleton_method_of_module? ⇒ Boolean
- #super_methods ⇒ Object
Constructor Details
#initialize(_method) ⇒ MethodHelper
Returns a new instance of MethodHelper.
6 7 8 |
# File 'lib/laplus/helper/method_helper.rb', line 6 def initialize(_method) @_method = _method end |
Instance Method Details
#alias? ⇒ Boolean
14 15 16 |
# File 'lib/laplus/helper/method_helper.rb', line 14 def alias? _method.original_name != _method.name end |
#owner_singleton? ⇒ Boolean
10 11 12 |
# File 'lib/laplus/helper/method_helper.rb', line 10 def owner_singleton? _method.owner.singleton_class? end |
#singleton_method_of_module? ⇒ Boolean
18 19 20 |
# File 'lib/laplus/helper/method_helper.rb', line 18 def singleton_method_of_module? owner_singleton? && _method.receiver.kind_of?(Module) end |
#super_methods ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/laplus/helper/method_helper.rb', line 22 def super_methods _super_methods = [_method] while super_method = _super_methods.last.super_method _super_methods << super_method end _super_methods.reverse end |