class Centaman::Service::BookingTime
Attributes
booking_type_id[R]
end_date[R]
start_date[R]
timed_ticket_type_id[R]
Public Class Methods
find(booking_type_id, booking_time_id, date)
click to toggle source
# File lib/centaman/service/booking_time.rb, line 18 def self.find(booking_type_id, booking_time_id, date) obj = new( booking_type_id: booking_type_id, booking_time_id: booking_time_id, start_date: date, end_date: date ) obj.objects.detect {|obj| obj.id == booking_time_id } end
Public Instance Methods
after_init(args)
click to toggle source
# File lib/centaman/service/booking_time.rb, line 6 def after_init(args) @booking_type_id = args[:booking_type_id] @start_date = args[:start_date] @end_date = args[:end_date] parse_dates @timed_ticket_type_id = args[:id] # when finding a particular time end
endpoint()
click to toggle source
# File lib/centaman/service/booking_time.rb, line 28 def endpoint '/ticket_services/TimedTicketType' end
format_date_to_string(date)
click to toggle source
# File lib/centaman/service/booking_time.rb, line 46 def format_date_to_string(date) date.strftime('%Y-%m-%d') end
object_class()
click to toggle source
# File lib/centaman/service/booking_time.rb, line 14 def object_class Centaman::Object::BookingTime end
options()
click to toggle source
Calls superclass method
# File lib/centaman/service/booking_time.rb, line 32 def options super + [ { key: 'BookingTypeId', value: booking_type_id }, { key: 'StartDate', value: start_date }, { key: 'EndDate', value: end_date }, { key: 'id', value: timed_ticket_type_id }, ] end
parse_dates()
click to toggle source
# File lib/centaman/service/booking_time.rb, line 41 def parse_dates @start_date = start_date.present? && start_date.is_a?(Date) ? format_date_to_string(start_date) : start_date @end_date = end_date.present? && end_date.is_a?(Date) ? format_date_to_string(end_date) : end_date end