Class: Web47core::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/web47core/config.rb

Overview

Configuration for the Web47Core platform

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



11
12
13
14
15
# File 'lib/web47core/config.rb', line 11

def initialize
  @email_able_models = []
  @switchboard_able_models = []
  @audit_model = :user
end

Instance Attribute Details

#audit_modelObject

Returns the value of attribute audit_model.



9
10
11
# File 'lib/web47core/config.rb', line 9

def audit_model
  @audit_model
end

#email_able_modelsObject

Returns the value of attribute email_able_models.



9
10
11
# File 'lib/web47core/config.rb', line 9

def email_able_models
  @email_able_models
end

#switchboard_able_modelsObject

Returns the value of attribute switchboard_able_models.



9
10
11
# File 'lib/web47core/config.rb', line 9

def switchboard_able_models
  @switchboard_able_models
end

Class Method Details

.audit_model_class_nameObject



35
36
37
# File 'lib/web47core/config.rb', line 35

def self.audit_model_class_name
  instance.audit_model.to_s.camelize
end

.audit_model_log_classObject



23
24
25
# File 'lib/web47core/config.rb', line 23

def self.audit_model_log_class
  audit_model_log_class_name.constantize
end

.audit_model_log_class_nameObject



27
28
29
# File 'lib/web47core/config.rb', line 27

def self.audit_model_log_class_name
  audit_model_log_symbol.camelize
end

.audit_model_log_symbolObject



31
32
33
# File 'lib/web47core/config.rb', line 31

def self.audit_model_log_symbol
  "#{instance.audit_model}_model_audit_log"
end

.method_missing(method, *args, &block) ⇒ Object

Provide access to the instance accessors through static methods



42
43
44
45
46
47
48
# File 'lib/web47core/config.rb', line 42

def self.method_missing(method, *args, &block)
  if instance.respond_to?(method)
    instance.send(method, *args)
  else
    super
  end
end

.resetObject



17
18
19
20
21
# File 'lib/web47core/config.rb', line 17

def self.reset
  instance.email_able_models = []
  instance.switchboard_able_models = []
  instance.audit_model = :user
end

.respond_to?(method_name, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/web47core/config.rb', line 50

def self.respond_to?(method_name, _include_private = false)
  instance.respond_to?(method_name) || super
end

.respond_to_missing?(method_name, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/web47core/config.rb', line 54

def self.respond_to_missing?(method_name, _include_private = false)
  instance.respond_to?(method_name) || super
end