Class: ConvenientService::Utils::Object::GetOwnMethod Private

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/object/get_own_method.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(object, method_name, private: false) ⇒ GetOwnMethod

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of GetOwnMethod.

Parameters:

  • object (Object)

    Can be any type.

  • method_name (Symbol, String)
  • private (Boolean) (defaults to: false)

Since:

  • 1.0.0



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_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



22
23
24
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 22

def method_name
  @method_name
end

#objectObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



16
17
18
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 16

def object
  @object
end

#privateObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



28
29
30
# File 'lib/convenient_service/utils/object/get_own_method.rb', line 28

def private
  @private
end

Instance Method Details

#callMethod

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 1.0.0



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