Class: BenefitsEducation::Amendment

Inherits:
Common::Base show all
Defined in:
lib/lighthouse/benefits_education/amendment.rb

Overview

Model for an amendment made to a user’s enrollment

Instance Attribute Summary collapse

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

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_dateString

Returns The date the amendment takes effect.

Returns:

  • (String)

    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_hoursFloat

Returns The number of credit hours the user was on campus.

Returns:

  • (Float)

    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_hoursFloat

Returns The number of credit hours the user took online.

Returns:

  • (Float)

    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

#statusString

Returns The enrollment status.

Returns:

  • (String)

    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

#typeString

Returns The amendment type.

Returns:

  • (String)

    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_amountFloat

Returns The institution’s financial contributions to the Yellow Ribbon Program.

Returns:

  • (Float)

    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