Class: Unit::Types::Counterparty

Inherits:
Object
  • Object
show all
Defined in:
lib/unit-ruby/types/counterparty.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_type = 
  @name = name
end

Instance Attribute Details

#account_numberObject (readonly)

Returns the value of attribute account_number.



4
5
6
# File 'lib/unit-ruby/types/counterparty.rb', line 4

def 
  @account_number
end

#account_typeObject (readonly)

Returns the value of attribute account_type.



4
5
6
# File 'lib/unit-ruby/types/counterparty.rb', line 4

def 
  @account_type
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/unit-ruby/types/counterparty.rb', line 4

def name
  @name
end

#routing_numberObject (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_apiObject



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_type: ,
    name: name
  }
end