Class: Gonebusy::EntitiesBookingResponse
- Defined in:
- lib/gonebusy/models/entities_booking_response.rb
Instance Attribute Summary collapse
-
#id ⇒ Integer
id of Booking.
-
#owner_id ⇒ Integer
id of owner of Booking.
-
#time_window ⇒ EntitiesTimeWindowResponse
TimeWindow corresponding to Booking.
-
#user_message ⇒ String
user requesting Booking may include a message.
-
#workflow_state ⇒ String
status of Booking.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(id = nil, owner_id = nil, time_window = nil, user_message = nil, workflow_state = nil) ⇒ EntitiesBookingResponse
constructor
A new instance of EntitiesBookingResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, owner_id = nil, time_window = nil, user_message = nil, workflow_state = nil) ⇒ EntitiesBookingResponse
Returns a new instance of EntitiesBookingResponse.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 38 def initialize(id = nil, owner_id = nil, time_window = nil, = nil, workflow_state = nil) @id = id @owner_id = owner_id @time_window = time_window = @workflow_state = workflow_state end |
Instance Attribute Details
#id ⇒ Integer
id of Booking
7 8 9 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 7 def id @id end |
#owner_id ⇒ Integer
id of owner of Booking
11 12 13 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 11 def owner_id @owner_id end |
#time_window ⇒ EntitiesTimeWindowResponse
TimeWindow corresponding to Booking
15 16 17 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 15 def time_window @time_window end |
#user_message ⇒ String
user requesting Booking may include a message
19 20 21 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 19 def end |
#workflow_state ⇒ String
status of Booking
23 24 25 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 23 def workflow_state @workflow_state end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 51 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash id = hash["id"] owner_id = hash["owner_id"] time_window = EntitiesTimeWindowResponse.from_hash(hash["time_window"]) if hash["time_window"] = hash["user_message"] workflow_state = hash["workflow_state"] # Create object from extracted values EntitiesBookingResponse.new(id, owner_id, time_window, , workflow_state) end end |
.names ⇒ Object
A mapping from model property names to API property names
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gonebusy/models/entities_booking_response.rb', line 26 def self.names if @hash.nil? @hash = {} @hash["id"] = "id" @hash["owner_id"] = "owner_id" @hash["time_window"] = "time_window" @hash["user_message"] = "user_message" @hash["workflow_state"] = "workflow_state" end @hash end |