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.
35 36 37 38 39 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 35 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.
22 23 24 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 22 def method_name @method_name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
16 17 18 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 16 def object @object end |
#private ⇒ Object (readonly)
Returns the value of attribute private.
28 29 30 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 28 def private @private end |
Instance Method Details
#call ⇒ Class
49 50 51 52 53 54 55 |
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 49 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 |