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.
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
21 22 23 |
# File 'lib/zunnit/api.rb', line 21 def get(action, ={}) request(:get, action, ) end |
#post(action, options = {}) ⇒ Object
Make a POST request to Zunnit’s API
26 27 28 |
# File 'lib/zunnit/api.rb', line 26 def post(action, ={}) request(:post, action, ) end |