Class: EacRubyUtils::CommonConcern::ModuleSetup

Inherits:
Object
  • Object
show all
Includes:
SimpleCache
Defined in:
lib/eac_ruby_utils/common_concern/module_setup.rb

Constant Summary

Constants included from SimpleCache

SimpleCache::UNCACHED_METHOD_NAME_SUFFIX, SimpleCache::UNCACHED_METHOD_PATTERN

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SimpleCache

#method_missing, #reset_cache, #respond_to_missing?, #sanitize_cache_key, uncached_method_name

Constructor Details

#initialize(common_concern, a_module) ⇒ ModuleSetup

Returns a new instance of ModuleSetup.



15
16
17
18
# File 'lib/eac_ruby_utils/common_concern/module_setup.rb', line 15

def initialize(common_concern, a_module)
  @common_concern = common_concern
  @a_module = a_module
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EacRubyUtils::SimpleCache

Instance Attribute Details

#a_moduleObject (readonly)

Returns the value of attribute a_module.



13
14
15
# File 'lib/eac_ruby_utils/common_concern/module_setup.rb', line 13

def a_module
  @a_module
end

#common_concernObject (readonly)

Returns the value of attribute common_concern.



13
14
15
# File 'lib/eac_ruby_utils/common_concern/module_setup.rb', line 13

def common_concern
  @common_concern
end

Instance Method Details

#runObject



20
21
22
23
24
# File 'lib/eac_ruby_utils/common_concern/module_setup.rb', line 20

def run
  a_module.extend(::ActiveSupport::Concern)
  include_or_prepend(:included, :include)
  include_or_prepend(:prepended, :prepend)
end