Class: Telephony::CallCenter
- Inherits:
-
Object
- Object
- Telephony::CallCenter
- Defined in:
- app/models/telephony/call_center.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
- .all ⇒ Object
- .find_by_name(name) ⇒ Object
- .load(rails_env, config_path = 'config/call_centers.yml') ⇒ Object
Instance Method Summary collapse
-
#initialize(opts) ⇒ CallCenter
constructor
A new instance of CallCenter.
Constructor Details
#initialize(opts) ⇒ CallCenter
Returns a new instance of CallCenter.
19 20 21 22 23 24 |
# File 'app/models/telephony/call_center.rb', line 19 def initialize opts @name = opts['name'] @host = opts['host'] @username = opts['username'] @password = opts['password'] end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
5 6 7 |
# File 'app/models/telephony/call_center.rb', line 5 def host @host end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'app/models/telephony/call_center.rb', line 5 def name @name end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'app/models/telephony/call_center.rb', line 5 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'app/models/telephony/call_center.rb', line 5 def username @username end |
Class Method Details
.all ⇒ Object
11 12 13 |
# File 'app/models/telephony/call_center.rb', line 11 def self.all @config.map { |entry| new entry } end |
.find_by_name(name) ⇒ Object
15 16 17 |
# File 'app/models/telephony/call_center.rb', line 15 def self.find_by_name name all.detect { |call_center| call_center.name == name } end |
.load(rails_env, config_path = 'config/call_centers.yml') ⇒ Object
7 8 9 |
# File 'app/models/telephony/call_center.rb', line 7 def self.load rails_env, config_path = 'config/call_centers.yml' @config ||= YAML.load_file(config_path)[rails_env] end |