Class: Centaman::Object::TicketType

Inherits:
Centaman::Object show all
Defined in:
lib/centaman/object/ticket_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Centaman::Object

#after_init, #define_variables, #initialize

Constructor Details

This class inherits a constructor from Centaman::Object

Instance Attribute Details

#discountObject (readonly)

Returns the value of attribute discount.



3
4
5
# File 'lib/centaman/object/ticket_type.rb', line 3

def discount
  @discount
end

#priceObject (readonly)

Returns the value of attribute price.



3
4
5
# File 'lib/centaman/object/ticket_type.rb', line 3

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



4
5
6
# File 'lib/centaman/object/ticket_type.rb', line 4

def quantity
  @quantity
end

Instance Method Details

#adult?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/centaman/object/ticket_type.rb', line 18

def adult?
  age_group == "adult"
end

#attributesObject

rubocop:disable Metrics/MethodLength



23
24
25
26
27
28
29
30
31
32
33
34
35
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
# File 'lib/centaman/object/ticket_type.rb', line 23

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