class WCC::Data::RESTEndpoint
Attributes
service[R]
Public Class Methods
new(args={})
click to toggle source
# File lib/wcc/data/rest_endpoint.rb, line 6 def initialize(args={}) @service = args[:service] end
Public Instance Methods
create(attrs, options={})
click to toggle source
# File lib/wcc/data/rest_endpoint.rb, line 18 def create(attrs, options={}) service.post(options.merge(body: attrs)) end
destroy(id, options={})
click to toggle source
# File lib/wcc/data/rest_endpoint.rb, line 26 def destroy(id, options={}) service.delete(options.merge(uri: id.to_s)) end
index(options={})
click to toggle source
# File lib/wcc/data/rest_endpoint.rb, line 10 def index(options={}) service.get(options) end
show(id, options={})
click to toggle source
# File lib/wcc/data/rest_endpoint.rb, line 14 def show(id, options={}) service.get(options.merge(uri: id.to_s)) end
update(id, attrs, options={})
click to toggle source
# File lib/wcc/data/rest_endpoint.rb, line 22 def update(id, attrs, options={}) service.patch(options.merge(uri: id.to_s, body: attrs)) end