Class: BenefitsEducation::Amendment
- Inherits:
-
Common::Base
- Object
- Common::Base
- BenefitsEducation::Amendment
- Defined in:
- lib/lighthouse/benefits_education/amendment.rb
Overview
Model for an amendment made to a user’s enrollment
Instance Attribute Summary collapse
-
#change_effective_date ⇒ String
The date the amendment takes effect.
-
#on_campus_hours ⇒ Float
The number of credit hours the user was on campus.
-
#online_hours ⇒ Float
The number of credit hours the user took online.
-
#status ⇒ String
The enrollment status.
-
#type ⇒ String
The amendment type.
-
#yellow_ribbon_amount ⇒ Float
The institution’s financial contributions to the Yellow Ribbon Program.
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Amendment
constructor
A new instance of Amendment.
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes
Constructor Details
#initialize(attributes) ⇒ Amendment
Returns a new instance of Amendment.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 30 def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end |
Instance Attribute Details
#change_effective_date ⇒ String
Returns The date the amendment takes effect.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 22 class Amendment < Common::Base attribute :on_campus_hours, Float attribute :online_hours, Float attribute :yellow_ribbon_amount, Float attribute :type, String attribute :status, String attribute :change_effective_date, String def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end end |
#on_campus_hours ⇒ Float
Returns The number of credit hours the user was on campus.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 22 class Amendment < Common::Base attribute :on_campus_hours, Float attribute :online_hours, Float attribute :yellow_ribbon_amount, Float attribute :type, String attribute :status, String attribute :change_effective_date, String def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end end |
#online_hours ⇒ Float
Returns The number of credit hours the user took online.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 22 class Amendment < Common::Base attribute :on_campus_hours, Float attribute :online_hours, Float attribute :yellow_ribbon_amount, Float attribute :type, String attribute :status, String attribute :change_effective_date, String def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end end |
#status ⇒ String
Returns The enrollment status.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 22 class Amendment < Common::Base attribute :on_campus_hours, Float attribute :online_hours, Float attribute :yellow_ribbon_amount, Float attribute :type, String attribute :status, String attribute :change_effective_date, String def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end end |
#type ⇒ String
Returns The amendment type.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 22 class Amendment < Common::Base attribute :on_campus_hours, Float attribute :online_hours, Float attribute :yellow_ribbon_amount, Float attribute :type, String attribute :status, String attribute :change_effective_date, String def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end end |
#yellow_ribbon_amount ⇒ Float
Returns The institution’s financial contributions to the Yellow Ribbon Program.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lighthouse/benefits_education/amendment.rb', line 22 class Amendment < Common::Base attribute :on_campus_hours, Float attribute :online_hours, Float attribute :yellow_ribbon_amount, Float attribute :type, String attribute :status, String attribute :change_effective_date, String def initialize(attributes) # Amendment objects previously weren't being serialized because of mismatched keys key_mapping = { 'residence_hours' => 'on_campus_hours', 'distance_hours' => 'online_hours', 'amendment_type' => 'type', 'amendment_status' => 'status', 'amendment_effective_date' => 'change_effective_date' } attributes.transform_keys! { |key| key_mapping[key] || key } super(attributes) end end |