Class: Unit::Types::Counterparty
- Inherits:
-
Object
- Object
- Unit::Types::Counterparty
- Defined in:
- lib/unit-ruby/types/counterparty.rb
Instance Attribute Summary collapse
-
#account_number ⇒ Object
readonly
Returns the value of attribute account_number.
-
#account_type ⇒ Object
readonly
Returns the value of attribute account_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#routing_number ⇒ Object
readonly
Returns the value of attribute routing_number.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json_api ⇒ Object
-
#initialize(routing_number:, account_number:, account_type:, name:) ⇒ Counterparty
constructor
A new instance of Counterparty.
Constructor Details
#initialize(routing_number:, account_number:, account_type:, name:) ⇒ Counterparty
Returns a new instance of Counterparty.
6 7 8 9 10 11 |
# File 'lib/unit-ruby/types/counterparty.rb', line 6 def initialize(routing_number:, account_number:, account_type:, name:) @routing_number = routing_number @account_number = account_number @account_type = account_type @name = name end |
Instance Attribute Details
#account_number ⇒ Object (readonly)
Returns the value of attribute account_number.
4 5 6 |
# File 'lib/unit-ruby/types/counterparty.rb', line 4 def account_number @account_number end |
#account_type ⇒ Object (readonly)
Returns the value of attribute account_type.
4 5 6 |
# File 'lib/unit-ruby/types/counterparty.rb', line 4 def account_type @account_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/unit-ruby/types/counterparty.rb', line 4 def name @name end |
#routing_number ⇒ Object (readonly)
Returns the value of attribute routing_number.
4 5 6 |
# File 'lib/unit-ruby/types/counterparty.rb', line 4 def routing_number @routing_number end |
Class Method Details
.cast(val) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/unit-ruby/types/counterparty.rb', line 13 def self.cast(val) return val if val.is_a? self return nil if val.nil? new( routing_number: val[:routing_number], account_number: val[:account_number], account_type: val[:account_type], name: val[:name] ) end |
Instance Method Details
#as_json_api ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/unit-ruby/types/counterparty.rb', line 25 def as_json_api { routing_number: routing_number, account_number: account_number, account_type: account_type, name: name } end |