Class: Africastalking::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/africastalking/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#apikeyObject

Returns the value of attribute apikey.



3
4
5
# File 'lib/africastalking/configuration.rb', line 3

def apikey
  @apikey
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/africastalking/configuration.rb', line 3

def username
  @username
end

Instance Method Details

#headerObject



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