Class: EVSSPolicy
- Inherits:
-
Struct
- Object
- Struct
- EVSSPolicy
- Defined in:
- app/policies/evss_policy.rb
Instance Attribute Summary collapse
-
#evss ⇒ Object
Returns the value of attribute evss.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #access? ⇒ Boolean (also: #rating_info_access?)
- #access_form526? ⇒ Boolean
- #access_letters? ⇒ Boolean
- #log_failure(policy) ⇒ Object private
- #log_success(policy) ⇒ Object private
Instance Attribute Details
#evss ⇒ Object
Returns the value of attribute evss
3 4 5 |
# File 'app/policies/evss_policy.rb', line 3 def evss @evss end |
#user ⇒ Object
Returns the value of attribute user
3 4 5 |
# File 'app/policies/evss_policy.rb', line 3 def user @user end |
Instance Method Details
#access? ⇒ Boolean Also known as: rating_info_access?
4 5 6 7 8 9 10 |
# File 'app/policies/evss_policy.rb', line 4 def access? if user.edipi.present? && user.ssn.present? && user.participant_id.present? log_success('access') else log_failure('access') end end |
#access_form526? ⇒ Boolean
21 22 23 24 25 26 27 28 |
# File 'app/policies/evss_policy.rb', line 21 def access_form526? if user.edipi.present? && user.ssn.present? && user.birls_id.present? && user.participant_id.present? && user.birth_date.present? log_success('form526') else log_failure('form526') end end |
#access_letters? ⇒ Boolean
12 13 14 15 16 17 18 19 |
# File 'app/policies/evss_policy.rb', line 12 def access_letters? if user.edipi.present? && user.ssn.present? && user.participant_id.present? && user&.vet360_contact_info&.mailing_address&.address_line1 log_success('letters') else log_failure('letters') end end |
#log_failure(policy) ⇒ Object (private)
39 40 41 42 |
# File 'app/policies/evss_policy.rb', line 39 def log_failure(policy) StatsD.increment('api.evss.policy.failure', tags: ["policy:#{policy}"]) if user.loa3? false end |
#log_success(policy) ⇒ Object (private)
34 35 36 37 |
# File 'app/policies/evss_policy.rb', line 34 def log_success(policy) StatsD.increment('api.evss.policy.success', tags: ["policy:#{policy}"]) if user.loa3? true end |