Class: ThePlaidApi::AssetReportInvestmentSecurity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::AssetReportInvestmentSecurity
- Defined in:
- lib/the_plaid_api/models/asset_report_investment_security.rb
Overview
Investment security associated with the account.
Instance Attribute Summary collapse
-
#name ⇒ String
A descriptive name for the security, suitable for display.
-
#security_id ⇒ String
A unique, Plaid-specific identifier for the security, used to associate securities with holdings.
-
#ticker_symbol ⇒ String
The security’s trading symbol for publicly traded securities, and otherwise a short identifier if available.
-
#type ⇒ String
The security type of the holding.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(security_id:, name:, ticker_symbol:, type:, additional_properties: nil) ⇒ AssetReportInvestmentSecurity
constructor
A new instance of AssetReportInvestmentSecurity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(security_id:, name:, ticker_symbol:, type:, additional_properties: nil) ⇒ AssetReportInvestmentSecurity
Returns a new instance of AssetReportInvestmentSecurity.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 67 def initialize(security_id:, name:, ticker_symbol:, type:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @security_id = security_id @name = name @ticker_symbol = ticker_symbol @type = type @additional_properties = additional_properties end |
Instance Attribute Details
#name ⇒ String
A descriptive name for the security, suitable for display.
22 23 24 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 22 def name @name end |
#security_id ⇒ String
A unique, Plaid-specific identifier for the security, used to associate securities with holdings. Like all Plaid identifiers, the ‘security_id` is case sensitive. The `security_id` may change if inherent details of the security change due to a corporate action, for example, in the event of a ticker symbol change or CUSIP change.
18 19 20 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 18 def security_id @security_id end |
#ticker_symbol ⇒ String
The security’s trading symbol for publicly traded securities, and otherwise a short identifier if available.
27 28 29 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 27 def ticker_symbol @ticker_symbol end |
#type ⇒ String
The security type of the holding. Valid security types are: ‘cash`: Cash, currency, and money market funds `cryptocurrency`: Digital or virtual currencies `derivative`: Options, warrants, and other derivative instruments `equity`: Domestic and foreign equities `etf`: Multi-asset exchange-traded investment funds `fixed income`: Bonds and certificates of deposit (CDs) `loan`: Loans and loan receivables `mutual fund`: Open- and closed-end vehicles pooling funds of multiple investors `other`: Unknown or other investment types
41 42 43 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 41 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. security_id = hash.key?('security_id') ? hash['security_id'] : nil name = hash.key?('name') ? hash['name'] : nil ticker_symbol = hash.key?('ticker_symbol') ? hash['ticker_symbol'] : nil type = hash.key?('type') ? hash['type'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AssetReportInvestmentSecurity.new(security_id: security_id, name: name, ticker_symbol: ticker_symbol, type: type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['security_id'] = 'security_id' @_hash['name'] = 'name' @_hash['ticker_symbol'] = 'ticker_symbol' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 62 63 64 65 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 59 def self.nullables %w[ name ticker_symbol type ] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 54 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
112 113 114 115 116 117 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 112 def inspect class_name = self.class.name.split('::').last "<#{class_name} security_id: #{@security_id.inspect}, name: #{@name.inspect},"\ " ticker_symbol: #{@ticker_symbol.inspect}, type: #{@type.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 |
# File 'lib/the_plaid_api/models/asset_report_investment_security.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} security_id: #{@security_id}, name: #{@name}, ticker_symbol:"\ " #{@ticker_symbol}, type: #{@type}, additional_properties: #{@additional_properties}>" end |