Class: Plaid::TransferType
- Defined in:
- lib/plaid/models/transfer_type.rb
Overview
Activity that modifies a position, but not through buy/sell activity e.g. options exercise, portfolio transfer
Instance Attribute Summary collapse
-
#adjustment ⇒ String
Increase or decrease in quantity of item.
-
#assignment ⇒ String
Assignment of short option holding.
-
#exercise ⇒ String
Exercise of an option or warrant contract.
-
#expire ⇒ String
Expiration of an option or warrant contract.
-
#merger ⇒ String
Stock exchanged at a pre-defined ratio as part of a merger between companies.
-
#spin_off ⇒ String
Inflow of stock from spin-off transaction of an existing holding.
-
#split ⇒ String
Inflow of stock from a forward split of an existing holding.
-
#transfer ⇒ String
Movement of assets into or out of an account.
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(assignment: SKIP, adjustment: SKIP, exercise: SKIP, expire: SKIP, merger: SKIP, spin_off: SKIP, split: SKIP, transfer: SKIP, additional_properties: nil) ⇒ TransferType
constructor
A new instance of TransferType.
-
#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(assignment: SKIP, adjustment: SKIP, exercise: SKIP, expire: SKIP, merger: SKIP, spin_off: SKIP, split: SKIP, transfer: SKIP, additional_properties: nil) ⇒ TransferType
Returns a new instance of TransferType.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/plaid/models/transfer_type.rb', line 79 def initialize(assignment: SKIP, adjustment: SKIP, exercise: SKIP, expire: SKIP, merger: SKIP, spin_off: SKIP, split: SKIP, transfer: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @assignment = assignment unless assignment == SKIP @adjustment = adjustment unless adjustment == SKIP @exercise = exercise unless exercise == SKIP @expire = expire unless expire == SKIP @merger = merger unless merger == SKIP @spin_off = spin_off unless spin_off == SKIP @split = split unless split == SKIP @transfer = transfer unless transfer == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#adjustment ⇒ String
Increase or decrease in quantity of item
19 20 21 |
# File 'lib/plaid/models/transfer_type.rb', line 19 def adjustment @adjustment end |
#assignment ⇒ String
Assignment of short option holding
15 16 17 |
# File 'lib/plaid/models/transfer_type.rb', line 15 def assignment @assignment end |
#exercise ⇒ String
Exercise of an option or warrant contract
23 24 25 |
# File 'lib/plaid/models/transfer_type.rb', line 23 def exercise @exercise end |
#expire ⇒ String
Expiration of an option or warrant contract
27 28 29 |
# File 'lib/plaid/models/transfer_type.rb', line 27 def expire @expire end |
#merger ⇒ String
Stock exchanged at a pre-defined ratio as part of a merger between companies
32 33 34 |
# File 'lib/plaid/models/transfer_type.rb', line 32 def merger @merger end |
#spin_off ⇒ String
Inflow of stock from spin-off transaction of an existing holding
36 37 38 |
# File 'lib/plaid/models/transfer_type.rb', line 36 def spin_off @spin_off end |
#split ⇒ String
Inflow of stock from a forward split of an existing holding
40 41 42 |
# File 'lib/plaid/models/transfer_type.rb', line 40 def split @split end |
#transfer ⇒ String
Movement of assets into or out of an account
44 45 46 |
# File 'lib/plaid/models/transfer_type.rb', line 44 def transfer @transfer end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/plaid/models/transfer_type.rb', line 97 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. assignment = hash.key?('assignment') ? hash['assignment'] : SKIP adjustment = hash.key?('adjustment') ? hash['adjustment'] : SKIP exercise = hash.key?('exercise') ? hash['exercise'] : SKIP expire = hash.key?('expire') ? hash['expire'] : SKIP merger = hash.key?('merger') ? hash['merger'] : SKIP spin_off = hash.key?('spin off') ? hash['spin off'] : SKIP split = hash.key?('split') ? hash['split'] : SKIP transfer = hash.key?('transfer') ? hash['transfer'] : SKIP # 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. TransferType.new(assignment: assignment, adjustment: adjustment, exercise: exercise, expire: expire, merger: merger, spin_off: spin_off, split: split, transfer: transfer, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/plaid/models/transfer_type.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['assignment'] = 'assignment' @_hash['adjustment'] = 'adjustment' @_hash['exercise'] = 'exercise' @_hash['expire'] = 'expire' @_hash['merger'] = 'merger' @_hash['spin_off'] = 'spin off' @_hash['split'] = 'split' @_hash['transfer'] = 'transfer' @_hash end |
.nullables ⇒ Object
An array for nullable fields
75 76 77 |
# File 'lib/plaid/models/transfer_type.rb', line 75 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/plaid/models/transfer_type.rb', line 61 def self.optionals %w[ assignment adjustment exercise expire merger spin_off split transfer ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
138 139 140 141 142 143 144 |
# File 'lib/plaid/models/transfer_type.rb', line 138 def inspect class_name = self.class.name.split('::').last "<#{class_name} assignment: #{@assignment.inspect}, adjustment: #{@adjustment.inspect},"\ " exercise: #{@exercise.inspect}, expire: #{@expire.inspect}, merger: #{@merger.inspect},"\ " spin_off: #{@spin_off.inspect}, split: #{@split.inspect}, transfer: #{@transfer.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 135 |
# File 'lib/plaid/models/transfer_type.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} assignment: #{@assignment}, adjustment: #{@adjustment}, exercise:"\ " #{@exercise}, expire: #{@expire}, merger: #{@merger}, spin_off: #{@spin_off}, split:"\ " #{@split}, transfer: #{@transfer}, additional_properties: #{@additional_properties}>" end |