Class: SMSWay::Config

Inherits:
Settingslogic show all
Defined in:
lib/config.rb

Class Method Summary collapse

Methods inherited from Settingslogic

#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_pathObject



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_fileObject



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

.envObject



45
46
47
# File 'lib/config.rb', line 45

def self.env
  defined?(Rails) ? Rails.env : ENV['SMSWAY_ENV']
end

.load_configurationObject



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

:no-doc:



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

def self.new_namespace(value) #:no-doc:
  @namespace = value
  reload!
end

.new_source(value) ⇒ Object

:no-doc:



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

def self.new_source(value) #:no-doc:
  @source = value
  reload!
end