Class: BtcPay::Client::Config
- Inherits:
-
Object
- Object
- BtcPay::Client::Config
- Defined in:
- lib/btcpay/client/config.rb
Constant Summary collapse
- AUTH_TOKEN_TYPE =
'token'
- BASIC_TOKEN_TYPE =
'Basic'
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
readonly
Returns the value of attribute auth_token.
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#basic_auth_token ⇒ Object
readonly
Returns the value of attribute basic_auth_token.
-
#store_id ⇒ Object
readonly
Returns the value of attribute store_id.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Config
constructor
A new instance of Config.
- #to_h ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 |
# File 'lib/btcpay/client/config.rb', line 11 def initialize(**kwargs) @base_url = load_url(kwargs[:base_url]) @user_agent = kwargs[:user_agent] || "btcpay_ruby/#{BtcPay::VERSION}" @store_id = kwargs[:store_id] load_auth_token(kwargs) end |
Instance Attribute Details
#auth_token ⇒ Object (readonly)
Returns the value of attribute auth_token.
9 10 11 |
# File 'lib/btcpay/client/config.rb', line 9 def auth_token @auth_token end |
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
9 10 11 |
# File 'lib/btcpay/client/config.rb', line 9 def @authorization end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
9 10 11 |
# File 'lib/btcpay/client/config.rb', line 9 def base_url @base_url end |
#basic_auth_token ⇒ Object (readonly)
Returns the value of attribute basic_auth_token.
9 10 11 |
# File 'lib/btcpay/client/config.rb', line 9 def basic_auth_token @basic_auth_token end |
#store_id ⇒ Object (readonly)
Returns the value of attribute store_id.
9 10 11 |
# File 'lib/btcpay/client/config.rb', line 9 def store_id @store_id end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
9 10 11 |
# File 'lib/btcpay/client/config.rb', line 9 def user_agent @user_agent end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/btcpay/client/config.rb', line 20 def to_h { auth_token: auth_token, basic_auth_token: basic_auth_token, base_url: base_url, user_agent: user_agent, store_id: store_id }.compact end |