Class: ShellDataReportingApIs::PricedTransactionReqV2InvoiceStatusEnum

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

Overview

Invoice status of the transactions. Mandatory Possible options:I - Invoiced, U – Un-Invoiced, A – All

Constant Summary collapse

PRICED_TRANSACTION_REQ_V2_INVOICE_STATUS_ENUM =
[
  # TODO: Write general description for I
  I = 'I'.freeze,

  # TODO: Write general description for U
  U = 'U'.freeze,

  # TODO: Write general description for A
  A = 'A'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = I) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_invoice_status_enum.rb', line 27

def self.from_value(value, default_value = I)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'i' then I
  when 'u' then U
  when 'a' then A
  else
    default_value
  end
end

.validate(value) ⇒ Object



21
22
23
24
25
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_invoice_status_enum.rb', line 21

def self.validate(value)
  return false if value.nil?

  PRICED_TRANSACTION_REQ_V2_INVOICE_STATUS_ENUM.include?(value)
end