Class: Camper::Calendar

Inherits:
APIObject show all
Defined in:
lib/camper/calendar.rb

Instance Attribute Summary

Attributes inherited from APIObject

#attrs, #client

Instance Method Summary (collapse)

Methods inherited from APIObject

#handle, #initialize, lazy_attr_reader

Constructor Details

This class inherits a constructor from Camper::APIObject

Instance Method Details

- (true, false) delete!

Delete the calendar

Returns:

  • (true, false)

    If successful, returns true. Otherwise, returns false



21
22
23
# File 'lib/camper/calendar.rb', line 21

def delete!
  client.delete("calendars/#{id}").success?
end

- (Camper::Calendar) update!(body)

Update the calendar

Parameters:

  • body (Hash)

    Data to be sent via POST to update

Options Hash (body):

  • :name (String)

    The name the calendar should have

Returns:

  • (Camper::Calendar)

    returns self with updated attributes if successful, otherwise returns false



14
15
16
# File 'lib/camper/calendar.rb', line 14

def update!(body)
  handle client.put("calendars/#{id}", body)
end