Class: Preneeds::DateRange

Inherits:
Base
  • Object
show all
Defined in:
app/models/preneeds/date_range.rb

Overview

Models a date range from a BurialForm form

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#as_json

Instance Attribute Details

#fromString

Returns ‘from’ date.

Returns:

  • (String)

    ‘from’ date



11
12
13
14
15
16
17
18
19
20
# File 'app/models/preneeds/date_range.rb', line 11

class DateRange < Preneeds::Base
  attribute :from, String
  attribute :to, String

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    %i[from to]
  end
end

#toString

Returns ‘to’ date.

Returns:

  • (String)

    ‘to’ date



11
12
13
14
15
16
17
18
19
20
# File 'app/models/preneeds/date_range.rb', line 11

class DateRange < Preneeds::Base
  attribute :from, String
  attribute :to, String

  # (see Preneeds::Applicant.permitted_params)
  #
  def self.permitted_params
    %i[from to]
  end
end

Class Method Details

.permitted_paramsArray

List of permitted params for use with Strong Parameters

Returns:

  • (Array)

    array of class attributes as symbols



17
18
19
# File 'app/models/preneeds/date_range.rb', line 17

def self.permitted_params
  %i[from to]
end