Class: Zferral::Client
- Inherits:
-
Object
- Object
- Zferral::Client
- Defined in:
- lib/zferral/client.rb
Overview
The Client holds the API credentials and orchestrates access to the Resources.
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
Instance Method Summary collapse
-
#campaign ⇒ Zferral::Campaign
A Campaign resource for this Client.
-
#event ⇒ Zferral::Event
A Event resource for this Client.
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
8 9 10 11 |
# File 'lib/zferral/client.rb', line 8 def initialize( = {}) self.subdomain = [:subdomain] || ['subdomain'] self.api_token = [:api_token] || ['api_token'] end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
5 6 7 |
# File 'lib/zferral/client.rb', line 5 def api_token @api_token end |
#subdomain ⇒ Object
Returns the value of attribute subdomain.
4 5 6 |
# File 'lib/zferral/client.rb', line 4 def subdomain @subdomain end |
Instance Method Details
#campaign ⇒ Zferral::Campaign
A Zferral::Campaign resource for this Client
16 17 18 |
# File 'lib/zferral/client.rb', line 16 def campaign Zferral::Campaign.connect(self) end |
#event ⇒ Zferral::Event
A Event resource for this Client
30 31 32 |
# File 'lib/zferral/client.rb', line 30 def event Zferral::Event.connect(self) end |