Module: Giraffi::Client::Axions
- Included in:
- Giraffi::Client
- Defined in:
- lib/giraffi/client/axions.rb
Overview
Defines methods related to the axions
Instance Method Summary collapse
-
#add_medium_to_axion(*args) ⇒ HTTParty::Response
Adds a medium to the axion.
-
#create_axion(options = {}) ⇒ HTTParty::Response
Creates a new axion.
-
#destroy_axion(id) ⇒ HTTParty::Response
Deletes the axion.
-
#execute_axion(id) ⇒ HTTParty::Response
Executes the desired axion.
-
#find_axion(id) ⇒ HTTParty::Response
Returns the desired axion.
-
#find_axions(options = {}) ⇒ HTTParty::Response
Returns the desired axions.
-
#find_media_by_axion(id, options = {}) ⇒ HTTParty::Response
Returns all media related to the desired axion.
-
#remove_medium_from_axion(*args) ⇒ HTTParty::Response
Removes a medium from the axion.
-
#update_axion(id, options = {}) ⇒ HTTParty::Response
Updates the desired axion.
Instance Method Details
#add_medium_to_axion(*args) ⇒ HTTParty::Response
Adds a medium to the axion
69 70 71 72 |
# File 'lib/giraffi/client/axions.rb', line 69 def add_medium_to_axion(*args) raise ArgumentError.new('The method `add_medium_to_axion` requires 2 argments (axion-id and medium-id)') if args.size != 2 self.class.put("/axions/#{args[0]}/media/#{args[-1]}.json?apikey=#{apikey}", :body => {}) end |
#create_axion(options = {}) ⇒ HTTParty::Response
Creates a new axion
39 40 41 |
# File 'lib/giraffi/client/axions.rb', line 39 def create_axion(={}) self.class.post("/axions.json?apikey=#{apikey}", :query => { :axion => }) end |
#destroy_axion(id) ⇒ HTTParty::Response
Deletes the axion
79 80 81 |
# File 'lib/giraffi/client/axions.rb', line 79 def destroy_axion(id) self.class.delete("/axions/#{id}?apikey=#{apikey}") end |
#execute_axion(id) ⇒ HTTParty::Response
Executes the desired axion
48 49 50 |
# File 'lib/giraffi/client/axions.rb', line 48 def execute_axion(id) self.class.post("/axions/#{id}/execute.json?apikey=#{apikey}") end |
#find_axion(id) ⇒ HTTParty::Response
Returns the desired axion
20 21 22 |
# File 'lib/giraffi/client/axions.rb', line 20 def find_axion(id) self.class.get("/axions/#{id}.json?apikey=#{apikey}") end |
#find_axions(options = {}) ⇒ HTTParty::Response
Returns the desired axions
11 12 13 |
# File 'lib/giraffi/client/axions.rb', line 11 def find_axions(={}) self.class.get("/axions.json?apikey=#{apikey}", :query => ) end |
#find_media_by_axion(id, options = {}) ⇒ HTTParty::Response
Returns all media related to the desired axion
30 31 32 |
# File 'lib/giraffi/client/axions.rb', line 30 def find_media_by_axion(id, ={}) self.class.get("/axions/#{id}/media.json?apikey=#{apikey}", :query => ) end |
#remove_medium_from_axion(*args) ⇒ HTTParty::Response
Removes a medium from the axion
90 91 92 93 |
# File 'lib/giraffi/client/axions.rb', line 90 def remove_medium_from_axion(*args) raise ArgumentError.new('The method `remove_medium_from_axion` requires 2 argments (axion-id and medium-id)') if args.size != 2 self.class.delete("/axions/#{args[0]}/media/#{args[-1]}.json?apikey=#{apikey}") end |
#update_axion(id, options = {}) ⇒ HTTParty::Response
Updates the desired axion
58 59 60 |
# File 'lib/giraffi/client/axions.rb', line 58 def update_axion(id, ={}) self.class.put("/axions/#{id}.json?apikey=#{apikey}", :query => { :axion => }, :body => {}) end |