Class: ConvenientService::Utils::Module::ClassMethodDefined Private

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/module/class_method_defined.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(mod, method_name, public: true, protected: true, private: false) ⇒ void

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.

Parameters:

  • mod (Class, Module)
  • method_name (String, Symbol)
  • public (Boolean) (defaults to: true)
  • protected (Boolean) (defaults to: true)
  • private (Boolean) (defaults to: false)

Since:

  • 1.0.0



54
55
56
57
58
59
60
# File 'lib/convenient_service/utils/module/class_method_defined.rb', line 54

def initialize(mod, method_name, public: true, protected: true, private: false)
  @mod = mod
  @method_name = method_name
  @public = public
  @protected = protected
  @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/module/class_method_defined.rb', line 22

def method_name
  @method_name
end

#modObject (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/module/class_method_defined.rb', line 16

def mod
  @mod
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



40
41
42
# File 'lib/convenient_service/utils/module/class_method_defined.rb', line 40

def private
  @private
end

#protectedObject (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



34
35
36
# File 'lib/convenient_service/utils/module/class_method_defined.rb', line 34

def protected
  @protected
end

#publicObject (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/module/class_method_defined.rb', line 28

def public
  @public
end

Instance Method Details

#callBoolean

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:

  • (Boolean)

Since:

  • 1.0.0



65
66
67
# File 'lib/convenient_service/utils/module/class_method_defined.rb', line 65

def call
  Utils::Method.defined?(method_name, mod.singleton_class, public: public, protected: protected, private: private)
end