Class: Tingee::Configuration
- Inherits:
-
Object
- Object
- Tingee::Configuration
- Defined in:
- lib/tingee/configuration.rb
Overview
Injected credentials — set via Tingee.configure (e.g. from a Rails initializer); this layer never reads any credential store itself.
Instance Attribute Summary collapse
-
#base_url ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project).
-
#client_id ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project).
-
#secret_token ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project).
-
#shop_id ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project).
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#validate! ⇒ Object
Called when a client is built, not at load — a credential-less env still boots.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 |
# File 'lib/tingee/configuration.rb', line 10 def initialize @base_url = "https://open-api.tingee.vn" end |
Instance Attribute Details
#base_url ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project). Optional: nil sends no shopId and Tingee auto-creates a throwaway shop per link.
8 9 10 |
# File 'lib/tingee/configuration.rb', line 8 def base_url @base_url end |
#client_id ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project). Optional: nil sends no shopId and Tingee auto-creates a throwaway shop per link.
8 9 10 |
# File 'lib/tingee/configuration.rb', line 8 def client_id @client_id end |
#secret_token ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project). Optional: nil sends no shopId and Tingee auto-creates a throwaway shop per link.
8 9 10 |
# File 'lib/tingee/configuration.rb', line 8 def secret_token @secret_token end |
#shop_id ⇒ Object
shop_id: every VA this app creates is grouped under one Tingee shop (one shop per project). Optional: nil sends no shopId and Tingee auto-creates a throwaway shop per link.
8 9 10 |
# File 'lib/tingee/configuration.rb', line 8 def shop_id @shop_id end |
Instance Method Details
#validate! ⇒ Object
Called when a client is built, not at load — a credential-less env still boots.
15 16 17 18 19 |
# File 'lib/tingee/configuration.rb', line 15 def validate! return if client_id && secret_token raise Error.new("CONFIG", "Missing Tingee credentials (client_id, secret_token) — set them via Tingee.configure") end |