Class: ConvenientService::Utils::Class::GetAttachedObject

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/class/get_attached_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(klass) ⇒ 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:



60
61
62
# File 'lib/convenient_service/utils/class/get_attached_object.rb', line 60

def initialize(klass)
  @klass = klass
end

Instance Attribute Details

#klassObject (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.



52
53
54
# File 'lib/convenient_service/utils/class/get_attached_object.rb', line 52

def klass
  @klass
end

Instance Method Details

#callClass?

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:



69
70
71
72
73
74
75
# File 'lib/convenient_service/utils/class/get_attached_object.rb', line 69

def call
  return unless klass
  return unless klass.is_a?(::Module)
  return unless klass.singleton_class?

  klass.attached_object
end