Class: Ingenico::Connect::SDK::Domain::Definitions::AirlineData

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/definitions/airline_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#agent_numeric_codeObject

String



16
17
18
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 16

def agent_numeric_code
  @agent_numeric_code
end

#codeObject

String



19
20
21
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 19

def code
  @code
end

#flight_dateObject

String



22
23
24
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 22

def flight_date
  @flight_date
end

#flight_legsObject



25
26
27
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 25

def flight_legs
  @flight_legs
end

#invoice_numberObject

String



28
29
30
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 28

def invoice_number
  @invoice_number
end

#is_e_ticketObject

true/false



31
32
33
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 31

def is_e_ticket
  @is_e_ticket
end

#is_registered_customerObject

true/false



34
35
36
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 34

def is_registered_customer
  @is_registered_customer
end

#is_restricted_ticketObject

true/false



37
38
39
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 37

def is_restricted_ticket
  @is_restricted_ticket
end

#is_third_partyObject

true/false



40
41
42
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 40

def is_third_party
  @is_third_party
end

#issue_dateObject

String



43
44
45
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 43

def issue_date
  @issue_date
end

#merchant_customer_idObject

String



46
47
48
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 46

def merchant_customer_id
  @merchant_customer_id
end

#nameObject

String



49
50
51
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 49

def name
  @name
end

#passenger_nameObject

String



52
53
54
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 52

def passenger_name
  @passenger_name
end

#passengersObject



55
56
57
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 55

def passengers
  @passengers
end

#place_of_issueObject

String



58
59
60
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 58

def place_of_issue
  @place_of_issue
end

#pnrObject

String



61
62
63
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 61

def pnr
  @pnr
end

#point_of_saleObject

String



64
65
66
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 64

def point_of_sale
  @point_of_sale
end

#pos_city_codeObject

String



67
68
69
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 67

def pos_city_code
  @pos_city_code
end

#ticket_delivery_methodObject

String



70
71
72
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 70

def ticket_delivery_method
  @ticket_delivery_method
end

#ticket_numberObject

String



73
74
75
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 73

def ticket_number
  @ticket_number
end

Instance Method Details

#from_hash(hash) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 100

def from_hash(hash)
  super
  if hash.has_key?('agentNumericCode')
    @agent_numeric_code = hash['agentNumericCode']
  end
  if hash.has_key?('code')
    @code = hash['code']
  end
  if hash.has_key?('flightDate')
    @flight_date = hash['flightDate']
  end
  if hash.has_key?('flightLegs')
    if !(hash['flightLegs'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['flightLegs']]
    end
    @flight_legs = []
    hash['flightLegs'].each do |e|
      @flight_legs << Ingenico::Connect::SDK::Domain::Definitions::AirlineFlightLeg.new_from_hash(e)
    end
  end
  if hash.has_key?('invoiceNumber')
    @invoice_number = hash['invoiceNumber']
  end
  if hash.has_key?('isETicket')
    @is_e_ticket = hash['isETicket']
  end
  if hash.has_key?('isRegisteredCustomer')
    @is_registered_customer = hash['isRegisteredCustomer']
  end
  if hash.has_key?('isRestrictedTicket')
    @is_restricted_ticket = hash['isRestrictedTicket']
  end
  if hash.has_key?('isThirdParty')
    @is_third_party = hash['isThirdParty']
  end
  if hash.has_key?('issueDate')
    @issue_date = hash['issueDate']
  end
  if hash.has_key?('merchantCustomerId')
    @merchant_customer_id = hash['merchantCustomerId']
  end
  if hash.has_key?('name')
    @name = hash['name']
  end
  if hash.has_key?('passengerName')
    @passenger_name = hash['passengerName']
  end
  if hash.has_key?('passengers')
    if !(hash['passengers'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['passengers']]
    end
    @passengers = []
    hash['passengers'].each do |e|
      @passengers << Ingenico::Connect::SDK::Domain::Definitions::AirlinePassenger.new_from_hash(e)
    end
  end
  if hash.has_key?('placeOfIssue')
    @place_of_issue = hash['placeOfIssue']
  end
  if hash.has_key?('pnr')
    @pnr = hash['pnr']
  end
  if hash.has_key?('pointOfSale')
    @point_of_sale = hash['pointOfSale']
  end
  if hash.has_key?('posCityCode')
    @pos_city_code = hash['posCityCode']
  end
  if hash.has_key?('ticketDeliveryMethod')
    @ticket_delivery_method = hash['ticketDeliveryMethod']
  end
  if hash.has_key?('ticketNumber')
    @ticket_number = hash['ticketNumber']
  end
end

#to_hObject



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/ingenico/connect/sdk/domain/definitions/airline_data.rb', line 75

def to_h
  hash = super
  add_to_hash(hash, 'agentNumericCode', @agent_numeric_code)
  add_to_hash(hash, 'code', @code)
  add_to_hash(hash, 'flightDate', @flight_date)
  add_to_hash(hash, 'flightLegs', @flight_legs)
  add_to_hash(hash, 'invoiceNumber', @invoice_number)
  add_to_hash(hash, 'isETicket', @is_e_ticket)
  add_to_hash(hash, 'isRegisteredCustomer', @is_registered_customer)
  add_to_hash(hash, 'isRestrictedTicket', @is_restricted_ticket)
  add_to_hash(hash, 'isThirdParty', @is_third_party)
  add_to_hash(hash, 'issueDate', @issue_date)
  add_to_hash(hash, 'merchantCustomerId', @merchant_customer_id)
  add_to_hash(hash, 'name', @name)
  add_to_hash(hash, 'passengerName', @passenger_name)
  add_to_hash(hash, 'passengers', @passengers)
  add_to_hash(hash, 'placeOfIssue', @place_of_issue)
  add_to_hash(hash, 'pnr', @pnr)
  add_to_hash(hash, 'pointOfSale', @point_of_sale)
  add_to_hash(hash, 'posCityCode', @pos_city_code)
  add_to_hash(hash, 'ticketDeliveryMethod', @ticket_delivery_method)
  add_to_hash(hash, 'ticketNumber', @ticket_number)
  hash
end