Class: FactPulse::InvoiceTypeCode

Inherits:
Object
  • Object
show all
Defined in:
lib/factpulse/models/invoice_type_code.rb

Constant Summary collapse

INVOICE =
"380".freeze
SELF_BILLED_INVOICE =
"389".freeze
FACTORED_INVOICE =
"393".freeze
SELF_BILLED_FACTORED_INVOICE =
"501".freeze
PREPAYMENT_INVOICE =
"386".freeze
SELF_BILLED_PREPAYMENT_INVOICE =
"500".freeze
CORRECTIVE_INVOICE =
"384".freeze
SELF_BILLED_CORRECTIVE_INVOICE =
"471".freeze
FACTORED_CORRECTIVE_INVOICE =
"472".freeze
SELF_BILLED_FACTORED_CORRECTIVE_INVOICE =
"473".freeze
CREDIT_NOTE =
"381".freeze
SELF_BILLED_CREDIT_NOTE =
"261".freeze
GLOBAL_ALLOWANCE_CREDIT_NOTE =
"262".freeze
FACTORED_CREDIT_NOTE =
"396".freeze
SELF_BILLED_FACTORED_CREDIT_NOTE =
"502".freeze
PREPAYMENT_CREDIT_NOTE =
"503".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



35
36
37
# File 'lib/factpulse/models/invoice_type_code.rb', line 35

def self.all_vars
  @all_vars ||= [INVOICE, SELF_BILLED_INVOICE, FACTORED_INVOICE, SELF_BILLED_FACTORED_INVOICE, PREPAYMENT_INVOICE, SELF_BILLED_PREPAYMENT_INVOICE, CORRECTIVE_INVOICE, SELF_BILLED_CORRECTIVE_INVOICE, FACTORED_CORRECTIVE_INVOICE, SELF_BILLED_FACTORED_CORRECTIVE_INVOICE, CREDIT_NOTE, SELF_BILLED_CREDIT_NOTE, GLOBAL_ALLOWANCE_CREDIT_NOTE, FACTORED_CREDIT_NOTE, SELF_BILLED_FACTORED_CREDIT_NOTE, PREPAYMENT_CREDIT_NOTE].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



42
43
44
# File 'lib/factpulse/models/invoice_type_code.rb', line 42

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

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



49
50
51
52
# File 'lib/factpulse/models/invoice_type_code.rb', line 49

def build_from_hash(value)
  return value if InvoiceTypeCode.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #InvoiceTypeCode"
end