Module: Mycrm::Domains

Defined in:
lib/mycrm/domains.rb

Overview

facades

Defined Under Namespace

Modules: Rescuer

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object

Uncomment this line to create categories as constants on load.

Mycrm.configuration.domains.each { |key, items| create_constant(key) }



47
48
49
50
# File 'lib/mycrm/domains.rb', line 47

def self.const_missing(name)
  return super unless Mycrm.configuration.domains.key?(name.to_underscore)
  create_constant(name)
end

.create_constant(name) ⇒ Object



52
53
54
55
# File 'lib/mycrm/domains.rb', line 52

def self.create_constant(name)
  domain = Mycrm::Domains.const_set(name.to_camelized, Module.new)
  domain.extend Mycrm::Domains::Rescuer
end