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.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#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, time_zone: nil, base_url: 'https://app.mpayer.co.ke/api/') ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(user_no: nil, token: nil, time_zone: nil, base_url: 'https://app.mpayer.co.ke/api/') ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 |
# File 'lib/mpayer_ruby/configuration.rb', line 5 def initialize(user_no:nil,token:nil,time_zone:nil,base_url:'https://app.mpayer.co.ke/api/') @base_url ||= base_url @user_no ||= user_no @token ||= token @time_zone ||= time_zone set_time_zone 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 |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
3 4 5 |
# File 'lib/mpayer_ruby/configuration.rb', line 3 def time_zone @time_zone 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
18 19 20 |
# File 'lib/mpayer_ruby/configuration.rb', line 18 def auth WSSE::header(user_no, token) unless user_no.nil? and token.nil? end |
#header ⇒ Object
22 23 24 |
# File 'lib/mpayer_ruby/configuration.rb', line 22 def header {'Content-Type'=> 'application/json', 'Accept' => 'application/json', 'X-WSSE' => auth.to_s} end |