class Centaman::Object::TicketType

Attributes

booking_time_id[R]
discount[R]
price[R]
quantity[RW]

Public Instance Methods

adult?() click to toggle source
# File lib/centaman/object/ticket_type.rb, line 22
def adult?
  age_group == 'adult'
end
after_init(args) click to toggle source
# File lib/centaman/object/ticket_type.rb, line 6
def after_init(args)
  @booking_time_id = args.fetch(:booking_time_id, nil)
end
attributes() click to toggle source

rubocop:disable Metrics/MethodLength

# File lib/centaman/object/ticket_type.rb, line 39
def attributes
  [
    Centaman::Attribute.new(
      centaman_key: "TicketId",
      app_key: :id,
      type: :integer
    ),
    Centaman::Attribute.new(
      centaman_key: "TicketDescription",
      app_key: :description,
      type: :string
    ),
    Centaman::Attribute.new(
      centaman_key: "TicketPrice",
      app_key: :price_including_tax,
      type: :float
    ),
    Centaman::Attribute.new(
      centaman_key: "TicketBookingFee",
      app_key: :booking_fee,
      type: :float
    ),
    Centaman::Attribute.new(
      centaman_key: "TicketFeeItemId",
      app_key: :fee_item_id,
      type: :integer
    ),
    Centaman::Attribute.new(
      centaman_key: "DepositPercentage",
      app_key: :deposit_percentage,
      type: :float
    ),
    Centaman::Attribute.new(
      centaman_key: "IsTaxInclusive",
      app_key: :is_tax_inclusive,
      type: :boolean
    ),
    Centaman::Attribute.new(
      centaman_key: "TaxPercentage",
      app_key: :tax_percentage,
      type: :float
    ),
    Centaman::Attribute.new(
      centaman_key: "TicketDescription",
      app_key: :age_group,
      type: :age_group
    ),
    Centaman::Attribute.new(
      centaman_key: "TicketDescription",
      app_key: :display_age_group,
      type: :display_age_group
    ),
  ]
end
child?() click to toggle source
# File lib/centaman/object/ticket_type.rb, line 30
def child?
  age_group == 'child'
end
senior?() click to toggle source
# File lib/centaman/object/ticket_type.rb, line 34
def senior?
  age_group == 'senior'
end
youth?() click to toggle source
# File lib/centaman/object/ticket_type.rb, line 26
def youth?
  age_group == 'youth'
end