Class: Preneeds::MilitaryRankInput

Inherits:
Common::Base show all
Includes:
ActiveModel::Validations
Defined in:
app/models/preneeds/military_rank_input.rb

Overview

Models the input needed to query Service#get_military_rank_for_branch_of_service For use within the BurialForm form.

Instance Attribute Summary collapse

Attributes inherited from Common::Base

#errors_hash, #metadata

Method Summary

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes

Constructor Details

This class inherits a constructor from Common::Base

Instance Attribute Details

#branch_of_serviceString

Returns branch of service abbreviated code.

Returns:

  • (String)

    branch of service abbreviated code



17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/preneeds/military_rank_input.rb', line 17

class MilitaryRankInput < Common::Base
  include ActiveModel::Validations

  # Some branches have no end_date, but api requires it just the same
  validates :start_date, :end_date, presence: true, format: /\A\d{4}-\d{2}-\d{2}\z/
  validates :branch_of_service, format: /\A\w{2}\z/

  attribute :branch_of_service, String
  attribute :start_date, XmlDate
  attribute :end_date, XmlDate
end

#end_dateXmlDate

Returns end date of branch of service.

Returns:

  • (XmlDate)

    end date of branch of service.



17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/preneeds/military_rank_input.rb', line 17

class MilitaryRankInput < Common::Base
  include ActiveModel::Validations

  # Some branches have no end_date, but api requires it just the same
  validates :start_date, :end_date, presence: true, format: /\A\d{4}-\d{2}-\d{2}\z/
  validates :branch_of_service, format: /\A\w{2}\z/

  attribute :branch_of_service, String
  attribute :start_date, XmlDate
  attribute :end_date, XmlDate
end

#start_dateXmlDate

Returns start date for branch of service.

Returns:

  • (XmlDate)

    start date for branch of service



17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/preneeds/military_rank_input.rb', line 17

class MilitaryRankInput < Common::Base
  include ActiveModel::Validations

  # Some branches have no end_date, but api requires it just the same
  validates :start_date, :end_date, presence: true, format: /\A\d{4}-\d{2}-\d{2}\z/
  validates :branch_of_service, format: /\A\w{2}\z/

  attribute :branch_of_service, String
  attribute :start_date, XmlDate
  attribute :end_date, XmlDate
end