Class: Mpayer::Configuration
- Inherits:
-
Object
- Object
- Mpayer::Configuration
- Defined in:
- lib/mpayer_ruby/configuration.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#token ⇒ Object
Returns the value of attribute token.
-
#user_no ⇒ Object
Returns the value of attribute user_no.
Instance Method Summary collapse
- #auth ⇒ Object
- #header ⇒ Object
-
#initialize(user_no: nil, token: nil, base_url: 'https://app.mpayer.co.ke/api/') ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(user_no: nil, token: nil, base_url: 'https://app.mpayer.co.ke/api/') ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 |
# File 'lib/mpayer_ruby/configuration.rb', line 5 def initialize(user_no:nil,token:nil,base_url:'https://app.mpayer.co.ke/api/') @base_url ||= base_url @user_no ||= user_no @token ||= token end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/mpayer_ruby/configuration.rb', line 3 def base_url @base_url end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/mpayer_ruby/configuration.rb', line 3 def token @token end |
#user_no ⇒ Object
Returns the value of attribute user_no.
3 4 5 |
# File 'lib/mpayer_ruby/configuration.rb', line 3 def user_no @user_no end |
Instance Method Details
#auth ⇒ Object
11 12 13 |
# File 'lib/mpayer_ruby/configuration.rb', line 11 def auth WSSE::header(user_no, token) unless user_no.nil? and token.nil? end |
#header ⇒ Object
15 16 17 |
# File 'lib/mpayer_ruby/configuration.rb', line 15 def header {'Content-Type'=> 'application/json', 'Accept' => 'application/json', 'X-WSSE' => auth.to_s} end |