Class: CybridApiBank::TradeFailureCodeBankModel

Inherits:
Object
  • Object
show all
Defined in:
lib/cybrid_api_bank_ruby/models/trade_failure_code_bank_model.rb

Constant Summary collapse

NON_SUFFICIENT_FUNDS =
"non_sufficient_funds".freeze
UNSUPPORTED =
"unsupported".freeze
LIMIT_EXCEEDED =
"limit_exceeded".freeze
EXPIRED_QUOTE =
"expired_quote".freeze
MARKET_VOLATILITY =
"market_volatility".freeze
NOT_FILLED =
"not_filled".freeze
DAILY_LIMIT_EXCEEDED =
"daily_limit_exceeded".freeze
WEEKLY_LIMIT_EXCEEDED =
"weekly_limit_exceeded".freeze
MONTHLY_LIMIT_EXCEEDED =
"monthly_limit_exceeded".freeze
LIFETIME_LIMIT_EXCEEDED =
"lifetime_limit_exceeded".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



29
30
31
# File 'lib/cybrid_api_bank_ruby/models/trade_failure_code_bank_model.rb', line 29

def self.all_vars
  @all_vars ||= [NON_SUFFICIENT_FUNDS, UNSUPPORTED, LIMIT_EXCEEDED, EXPIRED_QUOTE, MARKET_VOLATILITY, NOT_FILLED, DAILY_LIMIT_EXCEEDED, WEEKLY_LIMIT_EXCEEDED, MONTHLY_LIMIT_EXCEEDED, LIFETIME_LIMIT_EXCEEDED].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



36
37
38
# File 'lib/cybrid_api_bank_ruby/models/trade_failure_code_bank_model.rb', line 36

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



43
44
45
46
# File 'lib/cybrid_api_bank_ruby/models/trade_failure_code_bank_model.rb', line 43

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