Class: Gonebusy::GetBookingsResponse
- Defined in:
- lib/gonebusy/models/get_bookings_response.rb
Instance Attribute Summary collapse
-
#bookings ⇒ List of EntitiesBookingResponse
TODO: Write general description for this method.
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(bookings = nil) ⇒ GetBookingsResponse
constructor
A new instance of GetBookingsResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(bookings = nil) ⇒ GetBookingsResponse
Returns a new instance of GetBookingsResponse.
18 19 20 |
# File 'lib/gonebusy/models/get_bookings_response.rb', line 18 def initialize(bookings = nil) @bookings = bookings end |
Instance Attribute Details
#bookings ⇒ List of EntitiesBookingResponse
TODO: Write general description for this method
7 8 9 |
# File 'lib/gonebusy/models/get_bookings_response.rb', line 7 def bookings @bookings end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gonebusy/models/get_bookings_response.rb', line 23 def self.from_hash(hash) return nil unless hash # Extract variables from the hash # Parameter is an array, so we need to iterate through it bookings = nil if hash['bookings'] != nil bookings = Array.new hash['bookings'].each{|structure| bookings << (EntitiesBookingResponse.from_hash(structure) if structure)} end # Create object from extracted values GetBookingsResponse.new(bookings) end |
.names ⇒ Object
A mapping from model property names to API property names
10 11 12 13 14 15 16 |
# File 'lib/gonebusy/models/get_bookings_response.rb', line 10 def self.names if @_hash.nil? @_hash = {} @_hash["bookings"] = "bookings" end @_hash end |