Class: Alman::Booking
- Inherits:
-
ApiResource
- Object
- ApiResource
- Alman::Booking
- Defined in:
- lib/alman/resources/booking.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#created_at_rfc822 ⇒ Object
Returns the value of attribute created_at_rfc822.
-
#end_at ⇒ Object
Returns the value of attribute end_at.
-
#end_at_rfc822 ⇒ Object
Returns the value of attribute end_at_rfc822.
-
#id ⇒ Object
Returns the value of attribute id.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#object ⇒ Object
Returns the value of attribute object.
-
#start_at ⇒ Object
Returns the value of attribute start_at.
-
#start_at_rfc822 ⇒ Object
Returns the value of attribute start_at_rfc822.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#updated_at_rfc822 ⇒ Object
Returns the value of attribute updated_at_rfc822.
Attributes inherited from ApiResource
Class Method Summary collapse
- .all(params = {}, headers = {}) ⇒ Object
- .retrieve(booking_id, params = {}, headers = {}) ⇒ Object
- .update(booking_id, params = {}, headers = {}) ⇒ Object
Instance Method Summary collapse
- #delete(params = {}, headers = {}) ⇒ Object
- #refresh(params = {}, headers = {}) ⇒ Object
- #save(params = {}, headers = {}) ⇒ Object
Methods inherited from ApiResource
add_api_attribute, api_attribute_names, #api_attributes, api_subclass_fetch, api_subclasses, #changed_api_attributes, #clear_api_attributes, client, #determine_api_attribute_value, determine_api_attribute_value, #initialize, #inspect, #inspect_api_attributes, #inspect_nested, #refresh_from, register_api_subclass, #to_json
Constructor Details
This class inherits a constructor from Alman::ApiResource
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/alman/resources/booking.rb', line 3 def created_at @created_at end |
#created_at_rfc822 ⇒ Object
Returns the value of attribute created_at_rfc822.
4 5 6 |
# File 'lib/alman/resources/booking.rb', line 4 def created_at_rfc822 @created_at_rfc822 end |
#end_at ⇒ Object
Returns the value of attribute end_at.
5 6 7 |
# File 'lib/alman/resources/booking.rb', line 5 def end_at @end_at end |
#end_at_rfc822 ⇒ Object
Returns the value of attribute end_at_rfc822.
6 7 8 |
# File 'lib/alman/resources/booking.rb', line 6 def end_at_rfc822 @end_at_rfc822 end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/alman/resources/booking.rb', line 7 def id @id end |
#meta ⇒ Object
Returns the value of attribute meta.
8 9 10 |
# File 'lib/alman/resources/booking.rb', line 8 def end |
#object ⇒ Object
Returns the value of attribute object.
9 10 11 |
# File 'lib/alman/resources/booking.rb', line 9 def object @object end |
#start_at ⇒ Object
Returns the value of attribute start_at.
10 11 12 |
# File 'lib/alman/resources/booking.rb', line 10 def start_at @start_at end |
#start_at_rfc822 ⇒ Object
Returns the value of attribute start_at_rfc822.
11 12 13 |
# File 'lib/alman/resources/booking.rb', line 11 def start_at_rfc822 @start_at_rfc822 end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
12 13 14 |
# File 'lib/alman/resources/booking.rb', line 12 def updated_at @updated_at end |
#updated_at_rfc822 ⇒ Object
Returns the value of attribute updated_at_rfc822.
13 14 15 |
# File 'lib/alman/resources/booking.rb', line 13 def updated_at_rfc822 @updated_at_rfc822 end |
Class Method Details
.all(params = {}, headers = {}) ⇒ Object
15 16 17 18 |
# File 'lib/alman/resources/booking.rb', line 15 def self.all(params={}, headers={}) res = client.bookings.all(params, headers) res end |
.retrieve(booking_id, params = {}, headers = {}) ⇒ Object
20 21 22 23 |
# File 'lib/alman/resources/booking.rb', line 20 def self.retrieve(booking_id, params={}, headers={}) res = client.bookings.retrieve(booking_id, params, headers) res end |
.update(booking_id, params = {}, headers = {}) ⇒ Object
25 26 27 28 |
# File 'lib/alman/resources/booking.rb', line 25 def self.update(booking_id, params={}, headers={}) res = client.bookings.update(booking_id, params, headers) res end |
Instance Method Details
#delete(params = {}, headers = {}) ⇒ Object
35 36 37 38 |
# File 'lib/alman/resources/booking.rb', line 35 def delete(params={}, headers={}) res = client.bookings.delete(id, params, headers) self.refresh_from(res.json, res.api_method, res.client) end |
#refresh(params = {}, headers = {}) ⇒ Object
30 31 32 33 |
# File 'lib/alman/resources/booking.rb', line 30 def refresh(params={}, headers={}) res = client.bookings.retrieve(id, params, headers) self.refresh_from(res.json, res.api_method, res.client) end |
#save(params = {}, headers = {}) ⇒ Object
40 41 42 43 44 |
# File 'lib/alman/resources/booking.rb', line 40 def save(params={}, headers={}) params = ParamsBuilder.merge(api_attributes, params) res = client.bookings.update(id, params, headers) self.refresh_from(res.json, res.api_method, res.client) end |