Class: XeroRuby::PayrollNz::PaySlip
- Inherits:
-
Object
- Object
- XeroRuby::PayrollNz::PaySlip
- 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
-
#bacs_hash ⇒ Object
BACS Service User Number.
-
#deduction_lines ⇒ Object
Returns the value of attribute deduction_lines.
-
#earnings_lines ⇒ Object
Returns the value of attribute earnings_lines.
-
#employee_id ⇒ Object
The Xero identifier for payroll employee.
-
#employee_tax_lines ⇒ Object
Returns the value of attribute employee_tax_lines.
-
#employer_tax_lines ⇒ Object
Returns the value of attribute employer_tax_lines.
-
#first_name ⇒ Object
Employee first name.
-
#gross_earnings ⇒ Object
Total earnings before any deductions.
-
#gross_earnings_history ⇒ Object
Returns the value of attribute gross_earnings_history.
-
#last_edited ⇒ Object
The date payslip was last updated.
-
#last_name ⇒ Object
Employee last name.
-
#leave_accrual_lines ⇒ Object
Returns the value of attribute leave_accrual_lines.
-
#leave_earnings_lines ⇒ Object
Returns the value of attribute leave_earnings_lines.
-
#pay_run_id ⇒ Object
The Xero identifier for the associated payrun.
-
#pay_slip_id ⇒ Object
The Xero identifier for a PaySlip.
-
#payment_lines ⇒ Object
Returns the value of attribute payment_lines.
-
#payment_method ⇒ Object
The payment method code.
-
#reimbursement_lines ⇒ Object
Returns the value of attribute reimbursement_lines.
-
#statutory_deduction_lines ⇒ Object
Returns the value of attribute statutory_deduction_lines.
-
#superannuation_lines ⇒ Object
Returns the value of attribute superannuation_lines.
-
#tax_settings ⇒ Object
Returns the value of attribute tax_settings.
-
#timesheet_earnings_lines ⇒ Object
Returns the value of attribute timesheet_earnings_lines.
-
#total_deductions ⇒ Object
Total amount subtracted from an employee's earnings to reach total pay.
-
#total_earnings ⇒ Object
Total earnings before any deductions.
-
#total_employee_taxes ⇒ Object
The part of an employee's earnings that is deducted for tax purposes.
-
#total_employer_taxes ⇒ Object
The employer's tax obligation.
-
#total_pay ⇒ Object
The employee net pay.
-
#total_reimbursements ⇒ Object
Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment.
-
#total_statutory_deductions ⇒ Object
Total amounts required by law to subtract from the employee's earnings.
-
#total_superannuation ⇒ Object
Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PaySlip
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#parse_date(datestring) ⇒ Object
customized data_parser.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PaySlip
Initializes the object
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 363 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 209 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_hash ⇒ Object
BACS Service User Number
66 67 68 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 66 def bacs_hash @bacs_hash end |
#deduction_lines ⇒ Object
Returns the value of attribute deduction_lines.
84 85 86 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 84 def deduction_lines @deduction_lines end |
#earnings_lines ⇒ Object
Returns the value of attribute earnings_lines.
75 76 77 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 75 def earnings_lines @earnings_lines end |
#employee_id ⇒ Object
The Xero identifier for payroll employee
24 25 26 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 24 def employee_id @employee_id end |
#employee_tax_lines ⇒ Object
Returns the value of attribute employee_tax_lines.
99 100 101 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 99 def employee_tax_lines @employee_tax_lines end |
#employer_tax_lines ⇒ Object
Returns the value of attribute employer_tax_lines.
102 103 104 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 102 def employer_tax_lines @employer_tax_lines end |
#first_name ⇒ Object
Employee first name
33 34 35 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 33 def first_name @first_name end |
#gross_earnings ⇒ Object
Total earnings before any deductions. Same as total earnings for NZ.
42 43 44 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 42 def gross_earnings @gross_earnings end |
#gross_earnings_history ⇒ Object
Returns the value of attribute gross_earnings_history.
111 112 113 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 111 def gross_earnings_history @gross_earnings_history end |
#last_edited ⇒ Object
The date payslip was last updated
30 31 32 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 30 def last_edited @last_edited end |
#last_name ⇒ Object
Employee last name
36 37 38 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 36 def last_name @last_name end |
#leave_accrual_lines ⇒ Object
Returns the value of attribute leave_accrual_lines.
90 91 92 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 90 def leave_accrual_lines @leave_accrual_lines end |
#leave_earnings_lines ⇒ Object
Returns the value of attribute leave_earnings_lines.
78 79 80 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 78 def leave_earnings_lines @leave_earnings_lines end |
#pay_run_id ⇒ Object
The Xero identifier for the associated payrun
27 28 29 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 27 def pay_run_id @pay_run_id end |
#pay_slip_id ⇒ Object
The Xero identifier for a PaySlip
21 22 23 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 21 def pay_slip_id @pay_slip_id end |
#payment_lines ⇒ Object
Returns the value of attribute payment_lines.
96 97 98 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 96 def payment_lines @payment_lines end |
#payment_method ⇒ Object
The payment method code
69 70 71 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 69 def payment_method @payment_method end |
#reimbursement_lines ⇒ Object
Returns the value of attribute reimbursement_lines.
87 88 89 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 87 def reimbursement_lines @reimbursement_lines end |
#statutory_deduction_lines ⇒ Object
Returns the value of attribute statutory_deduction_lines.
105 106 107 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 105 def statutory_deduction_lines @statutory_deduction_lines end |
#superannuation_lines ⇒ Object
Returns the value of attribute superannuation_lines.
93 94 95 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 93 def superannuation_lines @superannuation_lines end |
#tax_settings ⇒ Object
Returns the value of attribute tax_settings.
108 109 110 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 108 def tax_settings @tax_settings end |
#timesheet_earnings_lines ⇒ Object
Returns the value of attribute timesheet_earnings_lines.
81 82 83 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 81 def timesheet_earnings_lines @timesheet_earnings_lines end |
#total_deductions ⇒ Object
Total amount subtracted from an employee's earnings to reach total pay
54 55 56 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 54 def total_deductions @total_deductions end |
#total_earnings ⇒ Object
Total earnings before any deductions. Same as gross earnings for NZ.
39 40 41 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 39 def total_earnings @total_earnings end |
#total_employee_taxes ⇒ Object
The part of an employee's earnings that is deducted for tax purposes
51 52 53 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 51 def total_employee_taxes @total_employee_taxes end |
#total_employer_taxes ⇒ Object
The employer's tax obligation
48 49 50 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 48 def total_employer_taxes @total_employer_taxes end |
#total_pay ⇒ Object
The employee net pay
45 46 47 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 45 def total_pay @total_pay end |
#total_reimbursements ⇒ Object
Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment
57 58 59 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 57 def total_reimbursements @total_reimbursements end |
#total_statutory_deductions ⇒ Object
Total amounts required by law to subtract from the employee's earnings
60 61 62 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 60 def total_statutory_deductions @total_statutory_deductions end |
#total_superannuation ⇒ Object
Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries
63 64 65 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 63 def total_superannuation @total_superannuation end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 136 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
442 443 444 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 442 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 205 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 172 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.
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 425 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 392 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
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 507 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 470 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) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
537 538 539 540 541 542 543 544 545 546 547 548 549 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 537 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 449 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
429 430 431 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 429 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
435 436 437 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 435 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_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
367 368 369 370 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 367 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#parse_date(datestring) ⇒ Object
customized data_parser
552 553 554 555 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 552 def parse_date(datestring) seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 return Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z').to_s end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
517 518 519 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 517 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
523 524 525 526 527 528 529 530 531 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 523 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
511 512 513 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 511 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
374 375 376 377 378 |
# File 'lib/xero-ruby/models/payroll_nz/pay_slip.rb', line 374 def valid? payment_method_validator = EnumAttributeValidator.new('String', ["Cheque", "Electronically", "Manual"]) return false unless payment_method_validator.valid?(@payment_method) true end |