Class: DebtPolicy

Inherits:
Struct
  • Object
show all
Defined in:
app/policies/debt_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#debtObject

Returns the value of attribute debt

Returns:

  • (Object)

    the current value of debt



3
4
5
# File 'app/policies/debt_policy.rb', line 3

def debt
  @debt
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



3
4
5
# File 'app/policies/debt_policy.rb', line 3

def user
  @user
end

Instance Method Details

#access?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
# File 'app/policies/debt_policy.rb', line 4

def access?
  accessible = user.icn.present? && user.ssn.present? && user.loa3?

  increment_statsd(accessible)
  accessible
end

#increment_statsd(accessible) ⇒ Object



11
12
13
14
15
16
17
# File 'app/policies/debt_policy.rb', line 11

def increment_statsd(accessible)
  if accessible
    StatsD.increment('api.debt.policy.success')
  else
    StatsD.increment('api.debt.policy.failure')
  end
end