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

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/module/include_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(mod, other_mod) ⇒ void

Parameters:



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)

Returns the value of attribute mod.



16
17
18
# File 'lib/convenient_service/utils/module/include_module.rb', line 16

def mod
  @mod
end

#other_modObject (readonly)

Returns the value of attribute other_mod.



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

def other_mod
  @other_mod
end

Instance Method Details

#callBoolean

Returns:

  • (Boolean)


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