Class: Centaman::Object::BookingTime
- Inherits:
-
Centaman::Object
- Object
- Centaman::Object
- Centaman::Object::BookingTime
- Defined in:
- lib/centaman/object/booking_time.rb
Overview
:nodoc: rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
-
#sold_out ⇒ Object
readonly
Returns the value of attribute sold_out.
Instance Method Summary collapse
-
#attributes ⇒ Object
rubocop:disable Metrics/MethodLength.
- #define_variables(args) ⇒ Object
-
#json ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/AbcSize.
Methods inherited from Centaman::Object
Constructor Details
This class inherits a constructor from Centaman::Object
Instance Attribute Details
#sold_out ⇒ Object (readonly)
Returns the value of attribute sold_out.
5 6 7 |
# File 'lib/centaman/object/booking_time.rb', line 5 def sold_out @sold_out end |
Instance Method Details
#attributes ⇒ Object
rubocop:disable Metrics/MethodLength
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/centaman/object/booking_time.rb', line 36 def attributes [ Centaman::Attribute.new( centaman_key: 'TimedTicketTypeId', app_key: :id, type: :integer ), Centaman::Attribute.new( centaman_key: 'BookingTypeId', app_key: :booking_type_id, type: :integer ), Centaman::Attribute.new( centaman_key: 'BookingTypeDescription', app_key: :booking_type_description, type: :string ), Centaman::Attribute.new( centaman_key: 'TimedTicketTypeDescription', app_key: :description, type: :centaman_description ), Centaman::Attribute.new( centaman_key: 'StartDate', app_key: :start_date, type: :datetime ), Centaman::Attribute.new( centaman_key: 'StartTime', app_key: :start_time, type: :string ), Centaman::Attribute.new( centaman_key: 'EndTime', app_key: :end_time, type: :string ), Centaman::Attribute.new( centaman_key: 'StartTime', app_key: :display_start_time, type: :display_time ), Centaman::Attribute.new( centaman_key: 'EndTime', app_key: :display_end_time, type: :display_time ), Centaman::Attribute.new( centaman_key: 'Capacity', app_key: :capacity, type: :integer ), Centaman::Attribute.new( centaman_key: 'vacancy', app_key: :vacancy, type: :integer ), Centaman::Attribute.new( centaman_key: 'vacancy', app_key: :remaining, type: :integer ), Centaman::Attribute.new( centaman_key: 'Bookingfee', app_key: :booking_fee, type: :float ), Centaman::Attribute.new( centaman_key: 'BookingFeeItemCode', app_key: :booking_fee_item_code, type: :integer ), Centaman::Attribute.new( centaman_key: 'Cancelled', app_key: :cancelled, type: :boolean ), Centaman::Attribute.new( centaman_key: 'IsBookedExclusively', app_key: :is_booked_exclusively, type: :boolean ) ] end |
#define_variables(args) ⇒ Object
7 8 9 10 |
# File 'lib/centaman/object/booking_time.rb', line 7 def define_variables(args) super @sold_out = vacancy <= 0 || is_booked_exclusively end |
#json ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/AbcSize
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/centaman/object/booking_time.rb', line 13 def json { id: id, booking_type_id: booking_type_id, booking_type_description: booking_type_description, description: description, start_date: start_date.strftime('%Y-%m-%d'), start_time: start_time, end_time: end_time, display_start_time: display_start_time, display_end_time: display_end_time, capacity: capacity, vacancy: vacancy, remaining: remaining, booking_fee: booking_fee, booking_fee_item_code: booking_fee_item_code, cancelled: cancelled, sold_out: sold_out } end |