Sha256: 21ea5061cf5738c76c79dd08d0e72ad14901e97e7de0d21c8086f57a1b2628e7

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

# #MoneyKit API
#
# No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
#
# The version of the OpenAPI document: 0.1.0
#
# Generated by: https://openapi-generator.tech
# OpenAPI Generator version: 6.5.0
#

require 'date'
require 'time'

module MoneyKit
  class AccountType
    DEPOSITORY_CASH = 'depository.cash'.freeze
    DEPOSITORY_CHECKING = 'depository.checking'.freeze
    DEPOSITORY_SAVINGS = 'depository.savings'.freeze
    DEPOSITORY_PREPAID = 'depository.prepaid'.freeze
    DEPOSITORY_OTHER = 'depository.other'.freeze
    CREDIT_CARD = 'credit_card'.freeze
    LOAN_GENERAL = 'loan.general'.freeze
    LOAN_MORTGAGE = 'loan.mortgage'.freeze
    LOAN_OTHER = 'loan.other'.freeze
    INVESTMENT = 'investment'.freeze
    OTHER = 'other'.freeze

    def self.all_vars
      @all_vars ||= [DEPOSITORY_CASH, DEPOSITORY_CHECKING, DEPOSITORY_SAVINGS, DEPOSITORY_PREPAID, DEPOSITORY_OTHER,
                     CREDIT_CARD, LOAN_GENERAL, LOAN_MORTGAGE, LOAN_OTHER, INVESTMENT, OTHER].freeze
    end

    # Builds the enum from string
    # @param [String] The enum value in the form of the string
    # @return [String] The enum value
    def self.build_from_hash(value)
      new.build_from_hash(value)
    end

    # Builds the enum from string
    # @param [String] The enum value in the form of the string
    # @return [String] The enum value
    def build_from_hash(value)
      return value if AccountType.all_vars.include?(value)

      raise "Invalid ENUM value #{value} for class #AccountType"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
moneykit-0.0.5 lib/moneykit/models/account_type.rb
moneykit-0.0.3 lib/moneykit/models/account_type.rb