Class: FactPulse::AFNORReasonCodeEnum

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

Constant Summary collapse

EMPTY_ATTACHEMENT =
"EmptyAttachement".freeze
ATTACHMENT_TYPE_ERROR =
"AttachmentTypeError".freeze
EMPTY_FLOW =
"EmptyFlow".freeze
OTHER_TECHNICAL_ERROR =
"OtherTechnicalError".freeze
INVALID_SCHEMA =
"InvalidSchema".freeze
FILE_SIZE_EXCEEDED =
"FileSizeExceeded".freeze
FLOW_TYPE_ERROR =
"FlowTypeError".freeze
ALREADY_EXISTING_FLOW =
"AlreadyExistingFlow".freeze
VIRUS_FOUND =
"VirusFound".freeze
CHECKSUM_MISMATCH =
"ChecksumMismatch".freeze
INVOICE_LC_INVALID_STATUS =
"InvoiceLCInvalidStatus".freeze
INVOICE_LC_STATUS_ERROR =
"InvoiceLCStatusError".freeze
INVOICE_LC_RULE_ERROR =
"InvoiceLCRuleError".freeze
INVOICE_LC_ACCESS_DENIED =
"InvoiceLCAccessDenied".freeze
INVOICE_LC_AMOUNT_ERROR =
"InvoiceLCAmountError".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



34
35
36
# File 'lib/factpulse/models/afnor_reason_code_enum.rb', line 34

def self.all_vars
  @all_vars ||= [EMPTY_ATTACHEMENT, ATTACHMENT_TYPE_ERROR, EMPTY_FLOW, OTHER_TECHNICAL_ERROR, INVALID_SCHEMA, FILE_SIZE_EXCEEDED, FLOW_TYPE_ERROR, ALREADY_EXISTING_FLOW, VIRUS_FOUND, CHECKSUM_MISMATCH, INVOICE_LC_INVALID_STATUS, INVOICE_LC_STATUS_ERROR, INVOICE_LC_RULE_ERROR, INVOICE_LC_ACCESS_DENIED, INVOICE_LC_AMOUNT_ERROR].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



41
42
43
# File 'lib/factpulse/models/afnor_reason_code_enum.rb', line 41

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



48
49
50
51
# File 'lib/factpulse/models/afnor_reason_code_enum.rb', line 48

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