class Seatsio::Event
def initialize(data)
def initialize(data) @id = data['id'] @key = data['key'] @chart_key = data['chartKey'] @name = data['name'] @date = Date.iso8601(data['date']) if data['date'] @supports_best_available = data['supportsBestAvailable'] @table_booking_config = TableBookingConfig::from_json(data['tableBookingConfig']) @for_sale_config = ForSaleConfig::from_json(data['forSaleConfig']) if data['forSaleConfig'] @created_on = parse_date(data['createdOn']) @updated_on = parse_date(data['updatedOn']) @channels = data['channels'].map { |d| Channel.new(d['key'], d['name'], d['color'], d['index'], d['objects']) } if data['channels'] @is_top_level_season = data['isTopLevelSeason'] @is_partial_season = data['isPartialSeason'] @is_event_in_season = data['isEventInSeason'] @top_level_season_key = data['topLevelSeasonKey'] @object_categories = data['objectCategories'] @categories = Category.create_list(data['categories']) if data['categories'] @is_in_the_past = data['isInThePast'] @partial_season_keys_for_event = data['partialSeasonKeysForEvent'] end