Class: Unit::Types::AccountLimits

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ach_limits:, card_limits:, check_deposit_limits:) ⇒ AccountLimits

Returns a new instance of AccountLimits.



6
7
8
9
10
# File 'lib/unit-ruby/types/account_limits.rb', line 6

def initialize(ach_limits:, card_limits:, check_deposit_limits:)
  @ach_limits = ach_limits
  @card_limits = card_limits
  @check_deposit_limits = check_deposit_limits
end

Instance Attribute Details

#ach_limitsObject (readonly)

Returns the value of attribute ach_limits.



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

def ach_limits
  @ach_limits
end

#card_limitsObject (readonly)

Returns the value of attribute card_limits.



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

def card_limits
  @card_limits
end

#check_deposit_limitsObject (readonly)

Returns the value of attribute check_deposit_limits.



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

def check_deposit_limits
  @check_deposit_limits
end

Class Method Details

.cast(val) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/unit-ruby/types/account_limits.rb', line 12

def self.cast(val)
  return val if val.is_a? self
  return nil if val.nil?

  new(
    ach_limits: AchLimits.cast(val[:attributes][:ach]),
    card_limits: CardLimits.cast(val[:attributes][:card]),
    check_deposit_limits: CheckDepositLimits.cast(val[:attributes][:check_deposit])
  )
end