Class: ShakeTheCounter::PriceType

Inherits:
Object
  • Object
show all
Defined in:
lib/shake_the_counter/price_type.rb

Overview

Sets up a PriceType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}, section: nil) ⇒ PriceType

Sets up a new price type



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/shake_the_counter/price_type.rb', line 22

def initialize(args={}, section: nil)
  self.section = section
  self.key = args["PriceTypeKey"]
  self.price_key = args["PriceKey"]
  self.name = args["PriceTypeName"]
  self.ticket_valid_from = DateTime.parse(args["TicketValidFrom"])
  self.ticket_valid_to = DateTime.parse(args["TicketValidTo"])
  self.phone_number_required = args["PhoneNumberRequired"]
  self.full_address_required = args["FullAddressRequired"]
  self.price = args["Price"].to_f
  self.requires_capacity_slot = args["RequiresCapacitySlot"]
  self.raw_data = args     
end

Instance Attribute Details

#full_address_requiredObject

Returns the value of attribute full_address_required.



13
14
15
# File 'lib/shake_the_counter/price_type.rb', line 13

def full_address_required
  @full_address_required
end

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/shake_the_counter/price_type.rb', line 6

def key
  @key
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/shake_the_counter/price_type.rb', line 9

def name
  @name
end

#phone_number_requiredObject

Returns the value of attribute phone_number_required.



12
13
14
# File 'lib/shake_the_counter/price_type.rb', line 12

def phone_number_required
  @phone_number_required
end

#priceObject

Returns the value of attribute price.



14
15
16
# File 'lib/shake_the_counter/price_type.rb', line 14

def price
  @price
end

#price_keyObject

Returns the value of attribute price_key.



7
8
9
# File 'lib/shake_the_counter/price_type.rb', line 7

def price_key
  @price_key
end

#product_codeObject

Returns the value of attribute product_code.



8
9
10
# File 'lib/shake_the_counter/price_type.rb', line 8

def product_code
  @product_code
end

#raw_dataObject

Returns the value of attribute raw_data.



18
19
20
# File 'lib/shake_the_counter/price_type.rb', line 18

def raw_data
  @raw_data
end

#requires_capacity_slotObject

Returns the value of attribute requires_capacity_slot.



15
16
17
# File 'lib/shake_the_counter/price_type.rb', line 15

def requires_capacity_slot
  @requires_capacity_slot
end

#sectionObject

Returns the value of attribute section.



17
18
19
# File 'lib/shake_the_counter/price_type.rb', line 17

def section
  @section
end

#ticket_valid_fromObject

Returns the value of attribute ticket_valid_from.



10
11
12
# File 'lib/shake_the_counter/price_type.rb', line 10

def ticket_valid_from
  @ticket_valid_from
end

#ticket_valid_toObject

Returns the value of attribute ticket_valid_to.



11
12
13
# File 'lib/shake_the_counter/price_type.rb', line 11

def ticket_valid_to
  @ticket_valid_to
end