Class: ShellDataReportingApIs::InvoiceDatesData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb

Overview

InvoiceDatesData Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(invoice_numbers = SKIP, invoice_dates = SKIP) ⇒ InvoiceDatesData

Returns a new instance of InvoiceDatesData.



42
43
44
45
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 42

def initialize(invoice_numbers = SKIP, invoice_dates = SKIP)
  @invoice_numbers = invoice_numbers unless invoice_numbers == SKIP
  @invoice_dates = invoice_dates unless invoice_dates == SKIP
end

Instance Attribute Details

#invoice_datesArray[String]

List of Invoicing dates. Format: yyyyMMdd

Returns:

  • (Array[String])


19
20
21
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 19

def invoice_dates
  @invoice_dates
end

#invoice_numbersArray[String]

List of Invoice numbers.

Returns:

  • (Array[String])


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 14

def invoice_numbers
  @invoice_numbers
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 48

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  invoice_numbers =
    hash.key?('InvoiceNumbers') ? hash['InvoiceNumbers'] : SKIP
  invoice_dates = hash.key?('InvoiceDates') ? hash['InvoiceDates'] : SKIP

  # Create object from extracted values.
  InvoiceDatesData.new(invoice_numbers,
                       invoice_dates)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
27
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['invoice_numbers'] = 'InvoiceNumbers'
  @_hash['invoice_dates'] = 'InvoiceDates'
  @_hash
end

.nullablesObject

An array for nullable fields



38
39
40
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 38

def self.nullables
  []
end

.optionalsObject

An array for optional fields



30
31
32
33
34
35
# File 'lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb', line 30

def self.optionals
  %w[
    invoice_numbers
    invoice_dates
  ]
end