Class: Whmcs::Configuration
- Inherits:
-
Object
- Object
- Whmcs::Configuration
- Defined in:
- lib/whmcs/configuration.rb
Instance Attribute Summary collapse
-
#api_password ⇒ Object
Returns the value of attribute api_password.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#api_user ⇒ Object
Returns the value of attribute api_user.
-
#http_auth_password ⇒ Object
Returns the value of attribute http_auth_password.
-
#http_auth_user ⇒ Object
Returns the value of attribute http_auth_user.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/whmcs/configuration.rb', line 11 def initialize if defined?(Rails) and File.exist?(File.('config/whmcs.yml', Rails.root)) config = YAML.load_file(File.('config/whmcs.yml', Rails.root))[Rails.env] @api_user = config['api_user'] if config['api_user'].present? @api_password = config['api_password'] if config['api_password'].present? @api_url = config['api_url'] if config['api_url'].present? @http_auth_user = config['http_auth_user'] if config['http_auth_user'].present? @http_auth_password = config['http_auth_password'] if config['http_auth_password'].present? end end |
Instance Attribute Details
#api_password ⇒ Object
Returns the value of attribute api_password.
5 6 7 |
# File 'lib/whmcs/configuration.rb', line 5 def api_password @api_password end |
#api_url ⇒ Object
Returns the value of attribute api_url.
5 6 7 |
# File 'lib/whmcs/configuration.rb', line 5 def api_url @api_url end |
#api_user ⇒ Object
Returns the value of attribute api_user.
5 6 7 |
# File 'lib/whmcs/configuration.rb', line 5 def api_user @api_user end |
#http_auth_password ⇒ Object
Returns the value of attribute http_auth_password.
5 6 7 |
# File 'lib/whmcs/configuration.rb', line 5 def http_auth_password @http_auth_password end |
#http_auth_user ⇒ Object
Returns the value of attribute http_auth_user.
5 6 7 |
# File 'lib/whmcs/configuration.rb', line 5 def http_auth_user @http_auth_user end |