Class: ConvenientService::Utils::Module::IncludeModule Private

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/module/include_module.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, other_mod) ⇒ 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:

Since:

  • 1.0.0



29
30
31
32
# File 'lib/convenient_service/utils/module/include_module.rb', line 29

def initialize(mod, other_mod)
  @mod = mod
  @other_mod = other_mod
end

Instance Attribute Details

#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/include_module.rb', line 16

def mod
  @mod
end

#other_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



22
23
24
# File 'lib/convenient_service/utils/module/include_module.rb', line 22

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



37
38
39
# File 'lib/convenient_service/utils/module/include_module.rb', line 37

def call
  mod.ancestors.drop_while { |ancestor| ancestor != mod }.include?(other_mod)
end