Class: Flix::Client
- Inherits:
-
Object
- Object
- Flix::Client
- Includes:
- API, Configurable
- Defined in:
- lib/flix/client.rb
Instance Attribute Summary
Attributes included from Configurable
#connection_options, #consumer_key, #consumer_secret, #endpoint, #identity_map, #middleware, #oauth_token, #oauth_token_secret
Instance Method Summary collapse
-
#delete(path, params = {}, options = {}) ⇒ Object
Perform an HTTP DELETE request.
-
#get(path, params = {}, options = {}) ⇒ Object
Perform an HTTP GET request.
-
#initialize(options = {}) ⇒ Flix::Client
constructor
Initializes a new Client object.
-
#post(path, params = {}, options = {}) ⇒ Object
Perform an HTTP POST request.
-
#put(path, params = {}, options = {}) ⇒ Object
Perform an HTTP UPDATE request.
Methods included from Configurable
#cache_key, #configure, #credentials?, keys, #reset!
Constructor Details
#initialize(options = {}) ⇒ Flix::Client
Initializes a new Client object
22 23 24 25 26 |
# File 'lib/flix/client.rb', line 22 def initialize(={}) Flix::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", [key] || Flix.instance_variable_get(:"@#{key}")) end end |
Instance Method Details
#delete(path, params = {}, options = {}) ⇒ Object
Perform an HTTP DELETE request
29 30 31 |
# File 'lib/flix/client.rb', line 29 def delete(path, params={}, ={}) request(:delete, path, params, ) end |
#get(path, params = {}, options = {}) ⇒ Object
Perform an HTTP GET request
34 35 36 |
# File 'lib/flix/client.rb', line 34 def get(path, params={}, ={}) request(:get, path, params, ) end |
#post(path, params = {}, options = {}) ⇒ Object
Perform an HTTP POST request
39 40 41 |
# File 'lib/flix/client.rb', line 39 def post(path, params={}, ={}) request(:post, path, params, ) end |
#put(path, params = {}, options = {}) ⇒ Object
Perform an HTTP UPDATE request
44 45 46 |
# File 'lib/flix/client.rb', line 44 def put(path, params={}, ={}) request(:put, path, params, ) end |