Top Level Namespace
Defined Under Namespace
Modules: Seatsio
Instance Method Summary collapse
- #create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats, accessible_seats) ⇒ Object
- #create_change_object_status_request(type, object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, allowed_previous_statuses, rejected_previous_statuses) ⇒ Object
- #normalize(object_or_objects) ⇒ Object
- #parse_date(date) ⇒ Object
Instance Method Details
#create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats, accessible_seats) ⇒ Object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/seatsio/events/change_best_available_object_status_request.rb', line 1 def create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats, accessible_seats) result = {} best_available = {'number': number} best_available[:categories] = categories if categories != nil best_available[:zone] = zone if zone != nil best_available[:extraData] = extra_data if extra_data != nil best_available[:ticketTypes] = ticket_types if ticket_types != nil best_available[:tryToPreventOrphanSeats] = try_to_prevent_orphan_seats if try_to_prevent_orphan_seats != nil best_available[:accessibleSeats] = accessible_seats if accessible_seats != nil result[:status] = status result[:bestAvailable] = best_available result[:holdToken] = hold_token if hold_token != nil result[:orderId] = order_id if order_id != nil result[:keepExtraData] = keep_extra_data if keep_extra_data != nil result[:ignoreChannels] = ignore_channels if ignore_channels != nil result[:channelKeys] = channel_keys if channel_keys != nil result end |
#create_change_object_status_request(type, object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, allowed_previous_statuses, rejected_previous_statuses) ⇒ Object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/seatsio/events/change_object_status_request.rb', line 1 def create_change_object_status_request(type, object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, allowed_previous_statuses, rejected_previous_statuses) result = {} result[:type] = type result[:objects] = normalize(object_or_objects) result[:type] = type result[:status] = status if type != Seatsio::StatusChangeType::RELEASE result[:holdToken] = hold_token if hold_token != nil result[:orderId] = order_id if order_id != nil if event_key_or_keys.is_a? Array result[:events] = event_key_or_keys else result[:events] = [event_key_or_keys] end result[:keepExtraData] = keep_extra_data if keep_extra_data != nil result[:ignoreChannels] = ignore_channels if ignore_channels != nil result[:channelKeys] = channel_keys if channel_keys != nil result[:allowedPreviousStatuses] = allowed_previous_statuses if allowed_previous_statuses != nil result[:rejectedPreviousStatuses] = rejected_previous_statuses if rejected_previous_statuses != nil result end |
#normalize(object_or_objects) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/seatsio/events/change_object_status_request.rb', line 22 def normalize(object_or_objects) if object_or_objects.is_a? Array if object_or_objects.length == 0 [] end result = [] object_or_objects.each do |object| result << object end return result end normalize([object_or_objects]) end |
#parse_date(date) ⇒ Object
1 2 3 |
# File 'lib/seatsio/util.rb', line 1 def parse_date(date) date end |