Class: SoapyCake::Client
- Inherits:
-
Object
- Object
- SoapyCake::Client
- Defined in:
- lib/soapy_cake/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#time_offset ⇒ Object
readonly
Returns the value of attribute time_offset.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 |
# File 'lib/soapy_cake/client.rb', line 5 def initialize(opts = {}) @domain = opts.fetch(:domain, ENV['CAKE_DOMAIN']) || fail(Error, 'Cake domain missing') @api_key = opts.fetch(:api_key, ENV['CAKE_API_KEY']) || fail(Error, 'Cake API key missing') @time_offset = opts.fetch(:time_offset, ENV['CAKE_TIME_OFFSET']) \ || fail(Error, 'Cake time offset missing') @opts = opts end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/soapy_cake/client.rb', line 3 def api_key @api_key end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
3 4 5 |
# File 'lib/soapy_cake/client.rb', line 3 def domain @domain end |
#time_offset ⇒ Object (readonly)
Returns the value of attribute time_offset.
3 4 5 |
# File 'lib/soapy_cake/client.rb', line 3 def time_offset @time_offset end |