Class: NewStoreApi::ReservationConfigUpdate
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::ReservationConfigUpdate
- Defined in:
- lib/new_store_api/models/reservation_config_update.rb
Overview
ReservationConfigUpdate Model.
Instance Attribute Summary collapse
-
#expires_in_min ⇒ Integer
Default duration for reservations, in minutes.
-
#send_accepted_emails ⇒ TrueClass | FalseClass
Whether to send emails to customers when a pending reservation is accepted by a store.
-
#send_rejected_emails ⇒ TrueClass | FalseClass
Whether to send emails to customers when a pending reservation is rejected by a store.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(expires_in_min = SKIP, send_accepted_emails = SKIP, send_rejected_emails = SKIP) ⇒ ReservationConfigUpdate
constructor
A new instance of ReservationConfigUpdate.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(expires_in_min = SKIP, send_accepted_emails = SKIP, send_rejected_emails = SKIP) ⇒ ReservationConfigUpdate
Returns a new instance of ReservationConfigUpdate.
53 54 55 56 57 58 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 53 def initialize(expires_in_min = SKIP, send_accepted_emails = SKIP, send_rejected_emails = SKIP) @expires_in_min = expires_in_min unless expires_in_min == SKIP @send_accepted_emails = send_accepted_emails unless send_accepted_emails == SKIP @send_rejected_emails = send_rejected_emails unless send_rejected_emails == SKIP end |
Instance Attribute Details
#expires_in_min ⇒ Integer
Default duration for reservations, in minutes.
14 15 16 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 14 def expires_in_min @expires_in_min end |
#send_accepted_emails ⇒ TrueClass | FalseClass
Whether to send emails to customers when a pending reservation is accepted by a store.
19 20 21 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 19 def send_accepted_emails @send_accepted_emails end |
#send_rejected_emails ⇒ TrueClass | FalseClass
Whether to send emails to customers when a pending reservation is rejected by a store.
24 25 26 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 24 def send_rejected_emails @send_rejected_emails end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. expires_in_min = hash.key?('expires_in_min') ? hash['expires_in_min'] : SKIP send_accepted_emails = hash.key?('send_accepted_emails') ? hash['send_accepted_emails'] : SKIP send_rejected_emails = hash.key?('send_rejected_emails') ? hash['send_rejected_emails'] : SKIP # Create object from extracted values. ReservationConfigUpdate.new(expires_in_min, send_accepted_emails, send_rejected_emails) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['expires_in_min'] = 'expires_in_min' @_hash['send_accepted_emails'] = 'send_accepted_emails' @_hash['send_rejected_emails'] = 'send_rejected_emails' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 48 49 50 51 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 45 def self.nullables %w[ expires_in_min send_accepted_emails send_rejected_emails ] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 41 42 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 36 def self.optionals %w[ expires_in_min send_accepted_emails send_rejected_emails ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} expires_in_min: #{@expires_in_min.inspect}, send_accepted_emails:"\ " #{@send_accepted_emails.inspect}, send_rejected_emails: #{@send_rejected_emails.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 83 |
# File 'lib/new_store_api/models/reservation_config_update.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} expires_in_min: #{@expires_in_min}, send_accepted_emails:"\ " #{@send_accepted_emails}, send_rejected_emails: #{@send_rejected_emails}>" end |