Class: ThePlaidApi::AssetInvestmentTransactionType
- Inherits:
-
Object
- Object
- ThePlaidApi::AssetInvestmentTransactionType
- Defined in:
- lib/the_plaid_api/models/asset_investment_transaction_type.rb
Overview
Asset Investment Transaction Type Enumerated derived by Vendor.
Constant Summary collapse
- ASSET_INVESTMENT_TRANSACTION_TYPE =
[ # TODO: Write general description for BUY BUY = 'Buy'.freeze, # TODO: Write general description for SELL SELL = 'Sell'.freeze, # TODO: Write general description for DIVIDENDS DIVIDENDS = 'Dividends'.freeze, # TODO: Write general description for INTEREST INTEREST = 'Interest'.freeze, # TODO: Write general description for TRANSFERS TRANSFERS = 'Transfers'.freeze, # TODO: Write general description for REINVESTMENTS REINVESTMENTS = 'Reinvestments'.freeze, # TODO: Write general description for FUNDSRECEIVED FUNDSRECEIVED = 'FundsReceived'.freeze, # TODO: Write general description for OTHER OTHER = 'Other'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = BUY) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/the_plaid_api/models/asset_investment_transaction_type.rb', line 41 def self.from_value(value, default_value = BUY) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'buy' then BUY when 'sell' then SELL when 'dividends' then DIVIDENDS when 'interest' then INTEREST when 'transfers' then TRANSFERS when 'reinvestments' then REINVESTMENTS when 'fundsreceived' then FUNDSRECEIVED when 'other' then OTHER else default_value end end |
.validate(value) ⇒ Object
35 36 37 38 39 |
# File 'lib/the_plaid_api/models/asset_investment_transaction_type.rb', line 35 def self.validate(value) return false if value.nil? ASSET_INVESTMENT_TRANSACTION_TYPE.include?(value) end |