Class: Unit::Types::AchLimits

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(daily_debit_limit:, daily_debit_limit_used:, monthly_debit_limit:, monthly_debit_limit_used:, daily_credit_limit:, daily_credit_limit_used:, monthly_credit_limit:, monthly_credit_limit_used:) ⇒ AchLimits

Returns a new instance of AchLimits.



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

def initialize(daily_debit_limit:, daily_debit_limit_used:,
               monthly_debit_limit:, monthly_debit_limit_used:,
               daily_credit_limit:, daily_credit_limit_used:,
               monthly_credit_limit:, monthly_credit_limit_used:)
  @daily_debit_limit = daily_debit_limit
  @daily_debit_limit_used = daily_debit_limit_used
  @monthly_debit_limit = monthly_debit_limit
  @monthly_debit_limit_used = monthly_debit_limit_used
  @daily_credit_limit = daily_credit_limit
  @daily_credit_limit_used = daily_credit_limit_used
  @monthly_credit_limit = monthly_credit_limit
  @monthly_credit_limit_used = monthly_credit_limit_used
end

Instance Attribute Details

#daily_credit_limitObject (readonly)

Returns the value of attribute daily_credit_limit.



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

def daily_credit_limit
  @daily_credit_limit
end

#daily_credit_limit_usedObject (readonly)

Returns the value of attribute daily_credit_limit_used.



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

def daily_credit_limit_used
  @daily_credit_limit_used
end

#daily_debit_limitObject (readonly)

Returns the value of attribute daily_debit_limit.



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

def daily_debit_limit
  @daily_debit_limit
end

#daily_debit_limit_usedObject (readonly)

Returns the value of attribute daily_debit_limit_used.



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

def daily_debit_limit_used
  @daily_debit_limit_used
end

#monthly_credit_limitObject (readonly)

Returns the value of attribute monthly_credit_limit.



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

def monthly_credit_limit
  @monthly_credit_limit
end

#monthly_credit_limit_usedObject (readonly)

Returns the value of attribute monthly_credit_limit_used.



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

def monthly_credit_limit_used
  @monthly_credit_limit_used
end

#monthly_debit_limitObject (readonly)

Returns the value of attribute monthly_debit_limit.



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

def monthly_debit_limit
  @monthly_debit_limit
end

#monthly_debit_limit_usedObject (readonly)

Returns the value of attribute monthly_debit_limit_used.



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

def monthly_debit_limit_used
  @monthly_debit_limit_used
end

Class Method Details

.cast(val) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/unit-ruby/types/ach_limits.rb', line 23

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

  new(
    daily_debit_limit: val[:limits][:daily_debit],
    daily_debit_limit_used: val[:totals_daily][:debits],
    monthly_debit_limit: val[:limits][:monthly_debit],
    monthly_debit_limit_used: val[:totals_monthly][:debits],
    daily_credit_limit: val[:limits][:daily_credit],
    daily_credit_limit_used: val[:totals_daily][:credits],
    monthly_credit_limit: val[:limits][:monthly_credit],
    monthly_credit_limit_used: val[:totals_monthly][:credits]
  )
end