Class: XeroRuby::PayrollNz::PaySlip

Inherits:
Object
  • Object
show all
Defined in:
lib/xero-ruby/models/payroll_nz/pay_slip.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Constant Summary collapse

CHEQUE =
"Cheque".freeze
ELECTRONICALLY =
"Electronically".freeze
MANUAL =
"Manual".freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PaySlip

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 208

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::PaySlip` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::PaySlip`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'pay_slip_id')
    self.pay_slip_id = attributes[:'pay_slip_id']
  end

  if attributes.key?(:'employee_id')
    self.employee_id = attributes[:'employee_id']
  end

  if attributes.key?(:'pay_run_id')
    self.pay_run_id = attributes[:'pay_run_id']
  end

  if attributes.key?(:'last_edited')
    self.last_edited = attributes[:'last_edited']
  end

  if attributes.key?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.key?(:'last_name')
    self.last_name = attributes[:'last_name']
  end

  if attributes.key?(:'total_earnings')
    self.total_earnings = attributes[:'total_earnings']
  end

  if attributes.key?(:'gross_earnings')
    self.gross_earnings = attributes[:'gross_earnings']
  end

  if attributes.key?(:'total_pay')
    self.total_pay = attributes[:'total_pay']
  end

  if attributes.key?(:'total_employer_taxes')
    self.total_employer_taxes = attributes[:'total_employer_taxes']
  end

  if attributes.key?(:'total_employee_taxes')
    self.total_employee_taxes = attributes[:'total_employee_taxes']
  end

  if attributes.key?(:'total_deductions')
    self.total_deductions = attributes[:'total_deductions']
  end

  if attributes.key?(:'total_reimbursements')
    self.total_reimbursements = attributes[:'total_reimbursements']
  end

  if attributes.key?(:'total_statutory_deductions')
    self.total_statutory_deductions = attributes[:'total_statutory_deductions']
  end

  if attributes.key?(:'total_superannuation')
    self.total_superannuation = attributes[:'total_superannuation']
  end

  if attributes.key?(:'bacs_hash')
    self.bacs_hash = attributes[:'bacs_hash']
  end

  if attributes.key?(:'payment_method')
    self.payment_method = attributes[:'payment_method']
  end

  if attributes.key?(:'earnings_lines')
    if (value = attributes[:'earnings_lines']).is_a?(Array)
      self.earnings_lines = value
    end
  end

  if attributes.key?(:'leave_earnings_lines')
    if (value = attributes[:'leave_earnings_lines']).is_a?(Array)
      self.leave_earnings_lines = value
    end
  end

  if attributes.key?(:'timesheet_earnings_lines')
    if (value = attributes[:'timesheet_earnings_lines']).is_a?(Array)
      self.timesheet_earnings_lines = value
    end
  end

  if attributes.key?(:'deduction_lines')
    if (value = attributes[:'deduction_lines']).is_a?(Array)
      self.deduction_lines = value
    end
  end

  if attributes.key?(:'reimbursement_lines')
    if (value = attributes[:'reimbursement_lines']).is_a?(Array)
      self.reimbursement_lines = value
    end
  end

  if attributes.key?(:'leave_accrual_lines')
    if (value = attributes[:'leave_accrual_lines']).is_a?(Array)
      self.leave_accrual_lines = value
    end
  end

  if attributes.key?(:'superannuation_lines')
    if (value = attributes[:'superannuation_lines']).is_a?(Array)
      self.superannuation_lines = value
    end
  end

  if attributes.key?(:'payment_lines')
    if (value = attributes[:'payment_lines']).is_a?(Array)
      self.payment_lines = value
    end
  end

  if attributes.key?(:'employee_tax_lines')
    if (value = attributes[:'employee_tax_lines']).is_a?(Array)
      self.employee_tax_lines = value
    end
  end

  if attributes.key?(:'employer_tax_lines')
    if (value = attributes[:'employer_tax_lines']).is_a?(Array)
      self.employer_tax_lines = value
    end
  end

  if attributes.key?(:'statutory_deduction_lines')
    if (value = attributes[:'statutory_deduction_lines']).is_a?(Array)
      self.statutory_deduction_lines = value
    end
  end

  if attributes.key?(:'tax_settings')
    self.tax_settings = attributes[:'tax_settings']
  end

  if attributes.key?(:'gross_earnings_history')
    self.gross_earnings_history = attributes[:'gross_earnings_history']
  end
end

Instance Attribute Details

#bacs_hashObject

BACS Service User Number



65
66
67
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 65

def bacs_hash
  @bacs_hash
end

#deduction_linesObject

Returns the value of attribute deduction_lines.



83
84
85
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 83

def deduction_lines
  @deduction_lines
end

#earnings_linesObject

Returns the value of attribute earnings_lines.



74
75
76
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 74

def earnings_lines
  @earnings_lines
end

#employee_idObject

The Xero identifier for payroll employee



23
24
25
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 23

def employee_id
  @employee_id
end

#employee_tax_linesObject

Returns the value of attribute employee_tax_lines.



98
99
100
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 98

def employee_tax_lines
  @employee_tax_lines
end

#employer_tax_linesObject

Returns the value of attribute employer_tax_lines.



101
102
103
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 101

def employer_tax_lines
  @employer_tax_lines
end

#first_nameObject

Employee first name



32
33
34
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 32

def first_name
  @first_name
end

#gross_earningsObject

Total earnings before any deductions. Same as total earnings for NZ.



41
42
43
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 41

def gross_earnings
  @gross_earnings
end

#gross_earnings_historyObject

Returns the value of attribute gross_earnings_history.



110
111
112
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 110

def gross_earnings_history
  @gross_earnings_history
end

#last_editedObject

The date payslip was last updated



29
30
31
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 29

def last_edited
  @last_edited
end

#last_nameObject

Employee last name



35
36
37
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 35

def last_name
  @last_name
end

#leave_accrual_linesObject

Returns the value of attribute leave_accrual_lines.



89
90
91
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 89

def leave_accrual_lines
  @leave_accrual_lines
end

#leave_earnings_linesObject

Returns the value of attribute leave_earnings_lines.



77
78
79
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 77

def leave_earnings_lines
  @leave_earnings_lines
end

#pay_run_idObject

The Xero identifier for the associated payrun



26
27
28
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 26

def pay_run_id
  @pay_run_id
end

#pay_slip_idObject

The Xero identifier for a PaySlip



20
21
22
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 20

def pay_slip_id
  @pay_slip_id
end

#payment_linesObject

Returns the value of attribute payment_lines.



95
96
97
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 95

def payment_lines
  @payment_lines
end

#payment_methodObject

The payment method code



68
69
70
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 68

def payment_method
  @payment_method
end

#reimbursement_linesObject

Returns the value of attribute reimbursement_lines.



86
87
88
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 86

def reimbursement_lines
  @reimbursement_lines
end

#statutory_deduction_linesObject

Returns the value of attribute statutory_deduction_lines.



104
105
106
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 104

def statutory_deduction_lines
  @statutory_deduction_lines
end

#superannuation_linesObject

Returns the value of attribute superannuation_lines.



92
93
94
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 92

def superannuation_lines
  @superannuation_lines
end

#tax_settingsObject

Returns the value of attribute tax_settings.



107
108
109
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 107

def tax_settings
  @tax_settings
end

#timesheet_earnings_linesObject

Returns the value of attribute timesheet_earnings_lines.



80
81
82
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 80

def timesheet_earnings_lines
  @timesheet_earnings_lines
end

#total_deductionsObject

Total amount subtracted from an employee’s earnings to reach total pay



53
54
55
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 53

def total_deductions
  @total_deductions
end

#total_earningsObject

Total earnings before any deductions. Same as gross earnings for NZ.



38
39
40
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 38

def total_earnings
  @total_earnings
end

#total_employee_taxesObject

The part of an employee’s earnings that is deducted for tax purposes



50
51
52
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 50

def total_employee_taxes
  @total_employee_taxes
end

#total_employer_taxesObject

The employer’s tax obligation



47
48
49
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 47

def total_employer_taxes
  @total_employer_taxes
end

#total_payObject

The employee net pay



44
45
46
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 44

def total_pay
  @total_pay
end

#total_reimbursementsObject

Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment



56
57
58
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 56

def total_reimbursements
  @total_reimbursements
end

#total_statutory_deductionsObject

Total amounts required by law to subtract from the employee’s earnings



59
60
61
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 59

def total_statutory_deductions
  @total_statutory_deductions
end

#total_superannuationObject

Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries



62
63
64
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 62

def total_superannuation
  @total_superannuation
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 135

def self.attribute_map
  {
    :'pay_slip_id' => :'paySlipID',
    :'employee_id' => :'employeeID',
    :'pay_run_id' => :'payRunID',
    :'last_edited' => :'lastEdited',
    :'first_name' => :'firstName',
    :'last_name' => :'lastName',
    :'total_earnings' => :'totalEarnings',
    :'gross_earnings' => :'grossEarnings',
    :'total_pay' => :'totalPay',
    :'total_employer_taxes' => :'totalEmployerTaxes',
    :'total_employee_taxes' => :'totalEmployeeTaxes',
    :'total_deductions' => :'totalDeductions',
    :'total_reimbursements' => :'totalReimbursements',
    :'total_statutory_deductions' => :'totalStatutoryDeductions',
    :'total_superannuation' => :'totalSuperannuation',
    :'bacs_hash' => :'bacsHash',
    :'payment_method' => :'paymentMethod',
    :'earnings_lines' => :'earningsLines',
    :'leave_earnings_lines' => :'leaveEarningsLines',
    :'timesheet_earnings_lines' => :'timesheetEarningsLines',
    :'deduction_lines' => :'deductionLines',
    :'reimbursement_lines' => :'reimbursementLines',
    :'leave_accrual_lines' => :'leaveAccrualLines',
    :'superannuation_lines' => :'superannuationLines',
    :'payment_lines' => :'paymentLines',
    :'employee_tax_lines' => :'employeeTaxLines',
    :'employer_tax_lines' => :'employerTaxLines',
    :'statutory_deduction_lines' => :'statutoryDeductionLines',
    :'tax_settings' => :'taxSettings',
    :'gross_earnings_history' => :'grossEarningsHistory'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



441
442
443
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 441

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_typesObject

Attribute type mapping.



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 171

def self.openapi_types
  {
    :'pay_slip_id' => :'String',
    :'employee_id' => :'String',
    :'pay_run_id' => :'String',
    :'last_edited' => :'Date',
    :'first_name' => :'String',
    :'last_name' => :'String',
    :'total_earnings' => :'BigDecimal',
    :'gross_earnings' => :'BigDecimal',
    :'total_pay' => :'BigDecimal',
    :'total_employer_taxes' => :'BigDecimal',
    :'total_employee_taxes' => :'BigDecimal',
    :'total_deductions' => :'BigDecimal',
    :'total_reimbursements' => :'BigDecimal',
    :'total_statutory_deductions' => :'BigDecimal',
    :'total_superannuation' => :'BigDecimal',
    :'bacs_hash' => :'String',
    :'payment_method' => :'String',
    :'earnings_lines' => :'Array<EarningsLine>',
    :'leave_earnings_lines' => :'Array<LeaveEarningsLine>',
    :'timesheet_earnings_lines' => :'Array<TimesheetEarningsLine>',
    :'deduction_lines' => :'Array<DeductionLine>',
    :'reimbursement_lines' => :'Array<ReimbursementLine>',
    :'leave_accrual_lines' => :'Array<LeaveAccrualLine>',
    :'superannuation_lines' => :'Array<SuperannuationLine>',
    :'payment_lines' => :'Array<PaymentLine>',
    :'employee_tax_lines' => :'Array<TaxLine>',
    :'employer_tax_lines' => :'Array<TaxLine>',
    :'statutory_deduction_lines' => :'Array<StatutoryDeductionLine>',
    :'tax_settings' => :'TaxSettings',
    :'gross_earnings_history' => :'GrossEarningsHistory'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 391

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pay_slip_id == o.pay_slip_id &&
      employee_id == o.employee_id &&
      pay_run_id == o.pay_run_id &&
      last_edited == o.last_edited &&
      first_name == o.first_name &&
      last_name == o.last_name &&
      total_earnings == o.total_earnings &&
      gross_earnings == o.gross_earnings &&
      total_pay == o.total_pay &&
      total_employer_taxes == o.total_employer_taxes &&
      total_employee_taxes == o.total_employee_taxes &&
      total_deductions == o.total_deductions &&
      total_reimbursements == o.total_reimbursements &&
      total_statutory_deductions == o.total_statutory_deductions &&
      total_superannuation == o.total_superannuation &&
      bacs_hash == o.bacs_hash &&
      payment_method == o.payment_method &&
      earnings_lines == o.earnings_lines &&
      leave_earnings_lines == o.leave_earnings_lines &&
      timesheet_earnings_lines == o.timesheet_earnings_lines &&
      deduction_lines == o.deduction_lines &&
      reimbursement_lines == o.reimbursement_lines &&
      leave_accrual_lines == o.leave_accrual_lines &&
      superannuation_lines == o.superannuation_lines &&
      payment_lines == o.payment_lines &&
      employee_tax_lines == o.employee_tax_lines &&
      employer_tax_lines == o.employer_tax_lines &&
      statutory_deduction_lines == o.statutory_deduction_lines &&
      tax_settings == o.tax_settings &&
      gross_earnings_history == o.gross_earnings_history
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 469

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(parse_date(value))
  when :Date
    Date.parse(parse_date(value))
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BigDecimal
    BigDecimal(value.to_s)
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    XeroRuby::PayrollNz.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value, downcase: false) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 542

def _to_hash(value, downcase: false)
  if value.is_a?(Array)
    value.map do |v|
      v.to_hash(downcase: downcase)
    end
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash(downcase: downcase)
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 448

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


428
429
430
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 428

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



434
435
436
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 434

def hash
  [pay_slip_id, employee_id, pay_run_id, last_edited, first_name, last_name, total_earnings, gross_earnings, total_pay, total_employer_taxes, total_employee_taxes, total_deductions, total_reimbursements, total_statutory_deductions, total_superannuation, bacs_hash, payment_method, earnings_lines, leave_earnings_lines, timesheet_earnings_lines, deduction_lines, reimbursement_lines, leave_accrual_lines, superannuation_lines, payment_lines, employee_tax_lines, employer_tax_lines, statutory_deduction_lines, tax_settings, gross_earnings_history].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



366
367
368
369
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 366

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#parse_date(datestring) ⇒ Object



558
559
560
561
562
563
564
565
566
567
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 558

def parse_date(datestring)
  if datestring.include?('Date')
    date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
    original, date, timezone = *date_pattern.match(datestring)
    date = (date.to_i / 1000)
    Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
  else # handle date 'types' for small subset of payroll API's
    Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
  end
end

#to_attributesObject

Returns the object in the form of hash with snake_case



534
535
536
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 534

def to_attributes
  to_hash(downcase: true)
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



516
517
518
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 516

def to_body
  to_hash
end

#to_hash(downcase: false) ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



522
523
524
525
526
527
528
529
530
531
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 522

def to_hash(downcase: false)
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    key = downcase ? attr : param
    hash[key] = _to_hash(value, downcase: downcase)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



510
511
512
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 510

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



373
374
375
376
377
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 373

def valid?
  payment_method_validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"])
  return false unless payment_method_validator.valid?(@payment_method)
  true
end