Class: SaasRunner::Client
- Inherits:
-
Object
- Object
- SaasRunner::Client
- Defined in:
- lib/saas_runner/client.rb
Instance Attribute Summary collapse
-
#api_host ⇒ Object
readonly
Returns the value of attribute api_host.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #activations ⇒ Object
- #delete(path, params) ⇒ Object
- #events ⇒ Object
- #get(path, params) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #post(path, body) ⇒ Object
-
#subscribers ⇒ Object
Public: Access the subscribers resource.
- #transactions ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 |
# File 'lib/saas_runner/client.rb', line 5 def initialize( = {}) @api_key = .fetch(:api_key) @api_host = .fetch(:api_host, 'api.saasrunner.com') end |
Instance Attribute Details
#api_host ⇒ Object (readonly)
Returns the value of attribute api_host.
3 4 5 |
# File 'lib/saas_runner/client.rb', line 3 def api_host @api_host end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/saas_runner/client.rb', line 3 def api_key @api_key end |
Instance Method Details
#activations ⇒ Object
21 22 23 |
# File 'lib/saas_runner/client.rb', line 21 def activations @activations ||= Resource::Activation.new(self) end |
#delete(path, params) ⇒ Object
37 38 39 |
# File 'lib/saas_runner/client.rb', line 37 def delete(path, params) request(:delete, path, params) end |
#events ⇒ Object
25 26 27 |
# File 'lib/saas_runner/client.rb', line 25 def events @events ||= Resource::Event.new(self) end |
#get(path, params) ⇒ Object
29 30 31 |
# File 'lib/saas_runner/client.rb', line 29 def get(path, params) request(:get, path, params) end |
#post(path, body) ⇒ Object
33 34 35 |
# File 'lib/saas_runner/client.rb', line 33 def post(path, body) request(:post, path, {}, body) end |
#subscribers ⇒ Object
Public: Access the subscribers resource
Returns a Resource::Subscriber
13 14 15 |
# File 'lib/saas_runner/client.rb', line 13 def subscribers @subscribers ||= Resource::Subscriber.new(self) end |
#transactions ⇒ Object
17 18 19 |
# File 'lib/saas_runner/client.rb', line 17 def transactions @transactions ||= Resource::Transaction.new(self) end |