Class: ConvenientService::Utils::Module::HasOwnInstanceMethod
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Module::HasOwnInstanceMethod
- Defined in:
- lib/convenient_service/utils/module/has_own_instance_method.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
-
#private ⇒ Object
readonly
Returns the value of attribute private.
Instance Method Summary collapse
Methods inherited from Support::Command
Constructor Details
#initialize(mod, method_name, private: false) ⇒ void
36 37 38 39 40 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 36 def initialize(mod, method_name, private: false) @mod = mod @method_name = method_name @private = private end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
22 23 24 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 22 def method_name @method_name end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
16 17 18 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 16 def mod @mod end |
#private ⇒ Object (readonly)
Returns the value of attribute private.
28 29 30 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 28 def private @private end |
Instance Method Details
#call ⇒ Boolean
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 45 def call method = method_name.to_sym return true if own_instance_methods.include?(method) if private return true if private_own_instance_methods.include?(method) end false end |