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
31 32 33 34 35 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 31 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.
17 18 19 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 17 def method_name @method_name end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
11 12 13 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 11 def mod @mod end |
#private ⇒ Object (readonly)
Returns the value of attribute private.
23 24 25 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 23 def private @private end |
Instance Method Details
#call ⇒ Boolean
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/convenient_service/utils/module/has_own_instance_method.rb', line 40 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 |