Class: SMSWay::Config
Class Method Summary
collapse
#method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Settingslogic
Class Method Details
.auth_options_of(client = self.active_client) ⇒ Object
49
50
51
|
# File 'lib/config.rb', line 49
def self.auth_options_of(client = self.active_client)
self[client]['auth_options']
end
|
.base_options_of(client = self.active_client) ⇒ Object
53
54
55
|
# File 'lib/config.rb', line 53
def self.base_options_of(client = self.active_client)
self[client]['base_options'] || {}
end
|
.clients_path ⇒ Object
41
42
43
|
# File 'lib/config.rb', line 41
def self.clients_path
File.join(defined?(Rails) ? Rails.root : Dir.pwd, 'lib', 'sms_way')
end
|
.config_file ⇒ Object
37
38
39
|
# File 'lib/config.rb', line 37
def self.config_file
File.join(defined?(Rails) ? Rails.root : Dir.pwd, 'config', 'sms_way.yml')
end
|
.env ⇒ Object
45
46
47
|
# File 'lib/config.rb', line 45
def self.env
defined?(Rails) ? Rails.env : ENV['SMSWAY_ENV']
end
|
.load_configuration ⇒ Object
21
22
23
24
|
# File 'lib/config.rb', line 21
def self.load_configuration
source self.config_file
namespace self.env
end
|
.new_namespace(value) ⇒ Object
31
32
33
34
|
# File 'lib/config.rb', line 31
def self.new_namespace(value)
@namespace = value
reload!
end
|
.new_source(value) ⇒ Object
26
27
28
29
|
# File 'lib/config.rb', line 26
def self.new_source(value)
@source = value
reload!
end
|