Class: Zunnit::Api
- Inherits:
-
Object
- Object
- Zunnit::Api
- Defined in:
- lib/zunnit/api.rb
Overview
API Class
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#key ⇒ Object
Returns the value of attribute key.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#get(action, options = {}) ⇒ Object
Make a GET request to Zunnit’s API.
-
#initialize {|_self| ... } ⇒ Api
constructor
A new instance of Api.
-
#post(action, options = {}) ⇒ Object
Make a POST request to Zunnit’s API.
- #url ⇒ Object
Constructor Details
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/zunnit/api.rb', line 10 def client @client end |
#key ⇒ Object
Returns the value of attribute key.
10 11 12 |
# File 'lib/zunnit/api.rb', line 10 def key @key end |
#version ⇒ Object
Returns the value of attribute version.
10 11 12 |
# File 'lib/zunnit/api.rb', line 10 def version @version end |
Instance Method Details
#get(action, options = {}) ⇒ Object
Make a GET request to Zunnit’s API
25 26 27 |
# File 'lib/zunnit/api.rb', line 25 def get(action, ={}) request(:get, action, ) end |
#post(action, options = {}) ⇒ Object
Make a POST request to Zunnit’s API
30 31 32 |
# File 'lib/zunnit/api.rb', line 30 def post(action, ={}) request(:post, action, ) end |
#url ⇒ Object
20 21 22 |
# File 'lib/zunnit/api.rb', line 20 def url "http://#{self.client}.zunnit.com/" end |