Class: Gonebusy::EntitiesSlots
- Defined in:
- lib/gonebusy/models/entities_slots.rb
Instance Attribute Summary collapse
-
#date ⇒ Date
date of availability.
-
#slots ⇒ List of String
array of available time slots.
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(date = nil, slots = nil) ⇒ EntitiesSlots
constructor
A new instance of EntitiesSlots.
Methods inherited from BaseModel
Constructor Details
#initialize(date = nil, slots = nil) ⇒ EntitiesSlots
Returns a new instance of EntitiesSlots.
23 24 25 26 27 |
# File 'lib/gonebusy/models/entities_slots.rb', line 23 def initialize(date = nil, slots = nil) @date = date @slots = slots end |
Instance Attribute Details
#date ⇒ Date
date of availability
7 8 9 |
# File 'lib/gonebusy/models/entities_slots.rb', line 7 def date @date end |
#slots ⇒ List of String
array of available time slots
11 12 13 |
# File 'lib/gonebusy/models/entities_slots.rb', line 11 def slots @slots end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gonebusy/models/entities_slots.rb', line 30 def self.from_hash(hash) return nil unless hash # Extract variables from the hash date = hash['date'] slots = hash['slots'] # Create object from extracted values EntitiesSlots.new(date, slots) end |
.names ⇒ Object
A mapping from model property names to API property names
14 15 16 17 18 19 20 21 |
# File 'lib/gonebusy/models/entities_slots.rb', line 14 def self.names if @_hash.nil? @_hash = {} @_hash["date"] = "date" @_hash["slots"] = "slots" end @_hash end |