Class: ThePlaidApi::Asset

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/asset.rb

Overview

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(asset_detail:, asset_owners:, asset_holder:, asset_transactions:, validation_sources:, additional_properties: nil) ⇒ Asset

Returns a new instance of Asset.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/the_plaid_api/models/asset.rb', line 58

def initialize(asset_detail:, asset_owners:, asset_holder:,
               asset_transactions:, validation_sources:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @asset_detail = asset_detail
  @asset_owners = asset_owners
  @asset_holder = asset_holder
  @asset_transactions = asset_transactions
  @validation_sources = validation_sources
  @additional_properties = additional_properties
end

Instance Attribute Details

#asset_detailAssetDetail

Details about an asset.

Returns:



15
16
17
# File 'lib/the_plaid_api/models/asset.rb', line 15

def asset_detail
  @asset_detail
end

#asset_holderAssetHolder

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



25
26
27
# File 'lib/the_plaid_api/models/asset.rb', line 25

def asset_holder
  @asset_holder
end

#asset_ownersAssetOwners

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



20
21
22
# File 'lib/the_plaid_api/models/asset.rb', line 20

def asset_owners
  @asset_owners
end

#asset_transactionsAssetTransactions

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



30
31
32
# File 'lib/the_plaid_api/models/asset.rb', line 30

def asset_transactions
  @asset_transactions
end

#validation_sourcesValidationSources

Documentation not found in the MISMO model viewer and not provided by Freddie Mac.

Returns:



35
36
37
# File 'lib/the_plaid_api/models/asset.rb', line 35

def validation_sources
  @validation_sources
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/the_plaid_api/models/asset.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  asset_detail = AssetDetail.from_hash(hash['ASSET_DETAIL']) if hash['ASSET_DETAIL']
  asset_owners = AssetOwners.from_hash(hash['ASSET_OWNERS']) if hash['ASSET_OWNERS']
  asset_holder = AssetHolder.from_hash(hash['ASSET_HOLDER']) if hash['ASSET_HOLDER']
  asset_transactions = AssetTransactions.from_hash(hash['ASSET_TRANSACTIONS']) if
    hash['ASSET_TRANSACTIONS']
  validation_sources = ValidationSources.from_hash(hash['VALIDATION_SOURCES']) if
    hash['VALIDATION_SOURCES']

  # 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.
  Asset.new(asset_detail: asset_detail,
            asset_owners: asset_owners,
            asset_holder: asset_holder,
            asset_transactions: asset_transactions,
            validation_sources: validation_sources,
            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/asset.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['asset_detail'] = 'ASSET_DETAIL'
  @_hash['asset_owners'] = 'ASSET_OWNERS'
  @_hash['asset_holder'] = 'ASSET_HOLDER'
  @_hash['asset_transactions'] = 'ASSET_TRANSACTIONS'
  @_hash['validation_sources'] = 'VALIDATION_SOURCES'
  @_hash
end

.nullablesObject

An array for nullable fields



54
55
56
# File 'lib/the_plaid_api/models/asset.rb', line 54

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
# File 'lib/the_plaid_api/models/asset.rb', line 49

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



111
112
113
114
115
116
117
# File 'lib/the_plaid_api/models/asset.rb', line 111

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} asset_detail: #{@asset_detail.inspect}, asset_owners:"\
  " #{@asset_owners.inspect}, asset_holder: #{@asset_holder.inspect}, asset_transactions:"\
  " #{@asset_transactions.inspect}, validation_sources: #{@validation_sources.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/asset.rb', line 102

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} asset_detail: #{@asset_detail}, asset_owners: #{@asset_owners},"\
  " asset_holder: #{@asset_holder}, asset_transactions: #{@asset_transactions},"\
  " validation_sources: #{@validation_sources}, additional_properties:"\
  " #{@additional_properties}>"
end