Class: SBF::Client::ShaveScheduleEndpoint

Inherits:
EntityEndpoint show all
Defined in:
lib/stbaldricks/endpoints/shave_schedule.rb

Instance Attribute Summary

Attributes inherited from EntityEndpoint

#orig_target_class

Instance Method Summary collapse

Methods inherited from EntityEndpoint

#aggregate, #create, #delete, #find, #find_first, #initialize, #save

Constructor Details

This class inherits a constructor from SBF::Client::EntityEndpoint

Instance Method Details

#get(id, year, with = {}) ⇒ Object



6
7
8
# File 'lib/stbaldricks/endpoints/shave_schedule.rb', line 6

def get(id, year, with = {})
  super("#{id}/#{year}", with)
end

#notify(data) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/stbaldricks/endpoints/shave_schedule.rb', line 14

def notify(data)
  response = SBF::Client::Api::Request.post_request("#{base_uri}/notify", data)

  if ok?(response)
    data = nil
  else
    parsed_response_body = JSON.parse(response.body).symbolize!
    error = SBF::Client::ErrorEntity.new(parsed_response_body)
  end

  SBF::Client::Api::Response.new(http_code: response.code, data: data, error: error)
end

#update(id, year, data, with = {}) ⇒ Object



10
11
12
# File 'lib/stbaldricks/endpoints/shave_schedule.rb', line 10

def update(id, year, data, with = {})
  super("#{id}/#{year}", data, with)
end