Class: Vantaca::Models::ProviderInsurance
- Defined in:
- lib/vantaca/models/provider_insurance.rb
Overview
A single insurance record - in our case, populated by Vive.
Instance Attribute Summary collapse
-
#provider ⇒ Object
readonly
!@attribute [r] provider @return [Vantaca::Models::Provider].
Attributes inherited from Base
Instance Method Summary collapse
- #account ⇒ String
-
#expiration_date ⇒ Time
For now, I’m going to assume that all insurance records include an expiration date.
- #expired? ⇒ Boolean
- #id ⇒ Integer
-
#initialize(data, provider:) ⇒ ProviderInsurance
constructor
A new instance of ProviderInsurance.
- #required? ⇒ Boolean
- #type ⇒ String
Methods inherited from Base
Constructor Details
#initialize(data, provider:) ⇒ ProviderInsurance
14 15 16 17 18 |
# File 'lib/vantaca/models/provider_insurance.rb', line 14 def initialize(data, provider:) super(data) @provider = provider end |
Instance Attribute Details
#provider ⇒ Object (readonly)
!@attribute [r] provider
@return [Vantaca::Models::Provider]
12 13 14 |
# File 'lib/vantaca/models/provider_insurance.rb', line 12 def provider @provider end |
Instance Method Details
#account ⇒ String
27 |
# File 'lib/vantaca/models/provider_insurance.rb', line 27 def account = data['accountNo'] |
#expiration_date ⇒ Time
For now, I’m going to assume that all insurance records include an expiration date.
31 |
# File 'lib/vantaca/models/provider_insurance.rb', line 31 def expiration_date = Time.parse(data['expirationDate']) |
#expired? ⇒ Boolean
34 |
# File 'lib/vantaca/models/provider_insurance.rb', line 34 def expired? = expiration_date < Time.now |
#id ⇒ Integer
21 |
# File 'lib/vantaca/models/provider_insurance.rb', line 21 def id = data['providerInsuranceID'] |
#required? ⇒ Boolean
37 |
# File 'lib/vantaca/models/provider_insurance.rb', line 37 def required? = @data['isRequired'] |
#type ⇒ String
24 |
# File 'lib/vantaca/models/provider_insurance.rb', line 24 def type = data['insuranceType'] |