Class: EventDrivenServices::HhSearch::Schemas::RestaurantAvailabilitySchema
- Inherits:
-
Object
- Object
- EventDrivenServices::HhSearch::Schemas::RestaurantAvailabilitySchema
- Defined in:
- app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb
Constant Summary collapse
- VALID_EVENT_TYPES =
[ EventDrivenClient::Constants::UPDATE_EVENT, ].freeze
Instance Attribute Summary collapse
-
#changed_attributes ⇒ Object
readonly
Returns the value of attribute changed_attributes.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#max_end_date ⇒ Object
readonly
Returns the value of attribute max_end_date.
-
#restaurant ⇒ Object
readonly
Returns the value of attribute restaurant.
Instance Method Summary collapse
-
#initialize(restaurant, event_type, changed_attributes) ⇒ RestaurantAvailabilitySchema
constructor
A new instance of RestaurantAvailabilitySchema.
-
#serialize ⇒ Hash
Serialize the restaurant tag to a hash.
-
#serialize_as_json ⇒ String
Serialize the restaurant tag to a JSON string.
Constructor Details
#initialize(restaurant, event_type, changed_attributes) ⇒ RestaurantAvailabilitySchema
Returns a new instance of RestaurantAvailabilitySchema.
11 12 13 14 15 16 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 11 def initialize(restaurant, event_type, changed_attributes) @restaurant = restaurant @event_type = validate_event_type(event_type) @changed_attributes = changed_attributes @max_end_date = restaurant.determine_max_availability_date end |
Instance Attribute Details
#changed_attributes ⇒ Object (readonly)
Returns the value of attribute changed_attributes.
5 6 7 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 5 def changed_attributes @changed_attributes end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
5 6 7 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 5 def event_type @event_type end |
#max_end_date ⇒ Object (readonly)
Returns the value of attribute max_end_date.
5 6 7 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 5 def max_end_date @max_end_date end |
#restaurant ⇒ Object (readonly)
Returns the value of attribute restaurant.
5 6 7 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 5 def restaurant @restaurant end |
Instance Method Details
#serialize ⇒ Hash
Serialize the restaurant tag to a hash
21 22 23 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 21 def serialize availability end |
#serialize_as_json ⇒ String
Serialize the restaurant tag to a JSON string
28 29 30 |
# File 'app/services/event_driven_services/hh_search/schemas/restaurant_availability_schema.rb', line 28 def serialize_as_json serialize.to_json end |