Class: Formulary::QHPDrugTier
- Inherits:
-
Object
- Object
- Formulary::QHPDrugTier
- Defined in:
- lib/formulary/qhp_drug_tier.rb
Overview
An individual drug tier as represented by QHP data
Instance Attribute Summary collapse
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
Instance Method Summary collapse
- #cost_sharing ⇒ Object
-
#initialize(tier) ⇒ QHPDrugTier
constructor
A new instance of QHPDrugTier.
- #mail_order? ⇒ Boolean
- #name ⇒ Object
Constructor Details
#initialize(tier) ⇒ QHPDrugTier
Returns a new instance of QHPDrugTier.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/formulary/qhp_drug_tier.rb', line 9 def initialize(tier) @tier = tier if tier[:drug_tier] == "ZERO-COST-SHARE-PREVENTIVE" tier[:drug_tier] = "ZERO-COST-SHARE-PREVENTATIVE" elsif tier[:drug_tier] == "MEDICAL-BENEFIT" tier[:drug_tier] = "MEDICAL-SERVICE" elsif tier[:drug_tier] == "NON-PREFERRED-BRAND-SPECIALTY" tier[:drug_tier] = "SPECIALTY" end end |
Instance Attribute Details
#tier ⇒ Object (readonly)
Returns the value of attribute tier.
7 8 9 |
# File 'lib/formulary/qhp_drug_tier.rb', line 7 def tier @tier end |
Instance Method Details
#cost_sharing ⇒ Object
[View source]
28 29 30 |
# File 'lib/formulary/qhp_drug_tier.rb', line 28 def cost_sharing @cost_sharing ||= tier[:cost_sharing].map { |cost| QHPDrugTierCostSharing.new(cost) } end |
#mail_order? ⇒ Boolean
24 25 26 |
# File 'lib/formulary/qhp_drug_tier.rb', line 24 def mail_order? tier[:mail_order] end |
#name ⇒ Object
[View source]
20 21 22 |
# File 'lib/formulary/qhp_drug_tier.rb', line 20 def name @name ||= tier[:drug_tier].downcase end |