Class: ConvenientService::Utils::Object::GetOwnMethod
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Object::GetOwnMethod
- Defined in:
- lib/convenient_service/utils/object/get_own_method.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#private ⇒ Object
readonly
Returns the value of attribute private.
Instance Method Summary collapse
- #call ⇒ Class
-
#initialize(object, method_name, private: false) ⇒ GetOwnMethod
constructor
A new instance of GetOwnMethod.
Methods inherited from Support::Command
Constructor Details
#initialize(object, method_name, private: false) ⇒ GetOwnMethod
Returns a new instance of GetOwnMethod.
30 31 32 33 34 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 30 def initialize(object, method_name, private: false) @object = object @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/object/get_own_method.rb', line 17 def method_name @method_name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
11 12 13 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 11 def object @object end |
#private ⇒ Object (readonly)
Returns the value of attribute private.
23 24 25 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 23 def private @private end |
Instance Method Details
#call ⇒ Class
44 45 46 47 48 49 50 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 44 def call own_method = Utils::Module.get_own_instance_method(object.class, method_name, private: private) return unless own_method own_method.bind(object) end |