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.



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

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.



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

def a_module
  @a_module
end

#common_concernObject (readonly)

Returns the value of attribute common_concern.



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

def common_concern
  @common_concern
end

Instance Method Details

#runObject



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

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