module RubyKong::Request::Api

Public Class Methods

create(*args) click to toggle source
# File lib/ruby-kong/request/api.rb, line 5
def create(*args)
  path = RubyKong.paths[:api][:create]
  Request.post(path, args[0])
end
delete(*args) click to toggle source
# File lib/ruby-kong/request/api.rb, line 27
def delete(*args)
  resource = args[0][:name] || args[0][:id]
  path     = RubyKong.paths[:api][:update] + resource
  Request.delete(path, args[0])
end
list(*args) click to toggle source
# File lib/ruby-kong/request/api.rb, line 10
def list(*args)
  path = RubyKong.paths[:api][:list]
  Request.get(path, args[0])
end
retrieve(*args) click to toggle source
# File lib/ruby-kong/request/api.rb, line 15
def retrieve(*args)
  resource = args[0][:name] || args[0][:id]
  path = RubyKong.paths[:api][:retrieve] + resource
  Request.get(path)
end
update(*args) click to toggle source
# File lib/ruby-kong/request/api.rb, line 21
def update(*args)
  resource = args[0][:name] || args[0][:id]
  path     = RubyKong.paths[:api][:update] + resource
  Request.patch(path, args[0])
end