Class: ChipRails::Configuration
- Inherits:
-
Object
- Object
- ChipRails::Configuration
- Defined in:
- lib/chip_rails.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#brand_id ⇒ Object
Returns the value of attribute brand_id.
-
#webhook_key ⇒ Object
Returns the value of attribute webhook_key.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 |
# File 'lib/chip_rails.rb', line 16 def initialize @webhook_key = ENV['CHIP_WEBHOOOK_KEY'] @api_key = ENV['CHIP_API_KEY'] @brand_id = ENV['CHIP_BRAND_ID'] @base_url = 'https://gate.chip-in.asia/api/v1/' end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
14 15 16 |
# File 'lib/chip_rails.rb', line 14 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
14 15 16 |
# File 'lib/chip_rails.rb', line 14 def base_url @base_url end |
#brand_id ⇒ Object
Returns the value of attribute brand_id.
14 15 16 |
# File 'lib/chip_rails.rb', line 14 def brand_id @brand_id end |
#webhook_key ⇒ Object
Returns the value of attribute webhook_key.
14 15 16 |
# File 'lib/chip_rails.rb', line 14 def webhook_key @webhook_key end |
Instance Method Details
#validate! ⇒ Object
23 24 25 26 27 |
# File 'lib/chip_rails.rb', line 23 def validate! raise 'ChipRails configuration: webhook_key is missing' unless @webhook_key raise 'ChipRails configuration: api_key is missing' unless @api_key raise 'ChipRails configuration: brand_id is missing' unless @brand_id end |