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:



55
56
57
# File 'lib/convenient_service/utils/class/get_attached_object.rb', line 55

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.



47
48
49
# File 'lib/convenient_service/utils/class/get_attached_object.rb', line 47

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:



64
65
66
67
68
69
70
# File 'lib/convenient_service/utils/class/get_attached_object.rb', line 64

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

  klass.attached_object
end