Class: Africastalking::Configuration
- Inherits:
-
Object
- Object
- Africastalking::Configuration
- Defined in:
- lib/africastalking/configuration.rb
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Returns the value of attribute apikey.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #header ⇒ Object
-
#initialize(params = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(params = {}) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 |
# File 'lib/africastalking/configuration.rb', line 5 def initialize(params={}) @user ||= params.dig(:username) @pass ||= params.dig(:apikey) end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
3 4 5 |
# File 'lib/africastalking/configuration.rb', line 3 def apikey @apikey end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/africastalking/configuration.rb', line 3 def username @username end |
Instance Method Details
#header ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/africastalking/configuration.rb', line 10 def header { "apikey" => apikey, 'Accept' => 'application/json', 'Content-Type'=> 'application/x-www-form-urlencoded' } end |