Class: Zonomi::API::Client
- Inherits:
-
Object
- Object
- Zonomi::API::Client
- Includes:
- HTTParty
- Defined in:
- lib/zonomi/api/client.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Class Method Summary collapse
Instance Method Summary collapse
- #api_request(params) ⇒ Object
-
#initialize(*args) ⇒ Client
constructor
A new instance of Client.
- #valid? ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ Client
Returns a new instance of Client.
20 21 22 23 24 25 |
# File 'lib/zonomi/api/client.rb', line 20 def initialize(*args) # options = args.extract_options! = args.last.is_a?(::Hash) ? args.pop : {} @api_key = ! args[0].nil? ? args[0] : .delete(:api_key) || '' @api = Adapter.new(self) end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
18 19 20 |
# File 'lib/zonomi/api/client.rb', line 18 def api @api end |
#api_key ⇒ Object
Returns the value of attribute api_key.
17 18 19 |
# File 'lib/zonomi/api/client.rb', line 17 def api_key @api_key end |