Class: TocDoc::Availability
- Defined in:
- lib/toc_doc/models/availability.rb
Overview
Represents a single availability date entry returned by the Doctolib API.
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#slots ⇒ Object
readonly
Returns the value of attribute slots.
Instance Method Summary collapse
-
#initialize(*attrs) ⇒ Availability
constructor
A new instance of Availability.
Methods inherited from Resource
#==, #[], #[]=, #method_missing, #to_h
Constructor Details
#initialize(*attrs) ⇒ Availability
Returns a new instance of Availability.
18 19 20 21 22 23 24 |
# File 'lib/toc_doc/models/availability.rb', line 18 def initialize(*attrs) super raw = build_raw(@attrs) @date = Date.parse(raw['date']) if raw['date'] @slots = raw['slots'].map { |s| DateTime.parse(s) } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class TocDoc::Resource
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
15 16 17 |
# File 'lib/toc_doc/models/availability.rb', line 15 def date @date end |
#slots ⇒ Object (readonly)
Returns the value of attribute slots.
15 16 17 |
# File 'lib/toc_doc/models/availability.rb', line 15 def slots @slots end |