Class: RestResource::RestCrud

Inherits:
Object
  • Object
show all
Defined in:
lib/rest_resource/rest_crud.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ RestCrud

Returns a new instance of RestCrud.



5
6
7
# File 'lib/rest_resource/rest_crud.rb', line 5

def initialize(url)
  @url = url
end

Instance Method Details

#create(params) ⇒ Object



13
14
15
# File 'lib/rest_resource/rest_crud.rb', line 13

def create(params)
  RestClient.post "#{url}.json", params
end

#find(resource_id) ⇒ Object



9
10
11
# File 'lib/rest_resource/rest_crud.rb', line 9

def find(resource_id)
  RestClient.get "#{url}/#{resource_id}.json"
end