Class: MedicalCopaysPolicy
- Inherits:
-
Struct
- Object
- Struct
- MedicalCopaysPolicy
- Defined in:
- app/policies/medical_copays_policy.rb
Instance Attribute Summary collapse
-
#medical_copays ⇒ Object
Returns the value of attribute medical_copays.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#access? ⇒ Boolean
Determines if the authenticated user has access to the Medical Copays feature.
- #access_notifications? ⇒ Boolean
Instance Attribute Details
#medical_copays ⇒ Object
Returns the value of attribute medical_copays
3 4 5 |
# File 'app/policies/medical_copays_policy.rb', line 3 def medical_copays @medical_copays end |
#user ⇒ Object
Returns the value of attribute user
3 4 5 |
# File 'app/policies/medical_copays_policy.rb', line 3 def user @user end |
Instance Method Details
#access? ⇒ Boolean
Determines if the authenticated user has access to the Medical Copays feature
10 11 12 13 14 15 |
# File 'app/policies/medical_copays_policy.rb', line 10 def access? accessible = user.edipi.present? && user.icn.present? StatsD.increment("api.mcp.policy.#{accessible ? 'success' : 'failure'}") accessible end |
#access_notifications? ⇒ Boolean
17 18 19 20 21 22 23 24 25 26 |
# File 'app/policies/medical_copays_policy.rb', line 17 def access_notifications? accessible = Flipper.enabled?('medical_copay_notifications') if accessible StatsD.increment('api.mcp.notification_policy.success') else StatsD.increment('api.mcp.notification_policy.failure') end accessible end |