Class: FactPulse::TypeFlux

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

Constant Summary collapse

CUSTOMER_INVOICE =
"CustomerInvoice".freeze
SUPPLIER_INVOICE =
"SupplierInvoice".freeze
CUSTOMER_INVOICE_LC =
"CustomerInvoiceLC".freeze
SUPPLIER_INVOICE_LC =
"SupplierInvoiceLC".freeze
E_REPORTING =
"eReporting".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



24
25
26
# File 'lib/factpulse/models/type_flux.rb', line 24

def self.all_vars
  @all_vars ||= [CUSTOMER_INVOICE, SUPPLIER_INVOICE, CUSTOMER_INVOICE_LC, SUPPLIER_INVOICE_LC, E_REPORTING].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



31
32
33
# File 'lib/factpulse/models/type_flux.rb', line 31

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



38
39
40
41
# File 'lib/factpulse/models/type_flux.rb', line 38

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