Class: MebPolicy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#my_education_benefitsObject

Returns the value of attribute my_education_benefits

Returns:

  • (Object)

    the current value of my_education_benefits



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

def my_education_benefits
  @my_education_benefits
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



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

def user
  @user
end

Instance Method Details

#access?Boolean

Returns:

  • (Boolean)


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

def access?
  accessible = user.icn.present? && user.ssn.present? && user.loa3?
  increment_statsd(accessible)
  accessible
end

#increment_statsd(accessible) ⇒ Object



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

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