Class: Preneeds::Cemetery

Inherits:
Common::Base show all
Defined in:
app/models/preneeds/cemetery.rb

Overview

Models a cemetery from the EOAS service. For use within the BurialForm form.

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, #initialize, max_per_page, per_page, sortable_attributes

Constructor Details

This class inherits a constructor from Common::Base

Instance Attribute Details

#cemetery_typeString

Returns cemetery type; one of ‘N’, ‘S’, ‘I’, ‘A’, ‘M’.

Returns:

  • (String)

    cemetery type; one of ‘N’, ‘S’, ‘I’, ‘A’, ‘M’



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/preneeds/cemetery.rb', line 16

class Cemetery < Common::Base
  attribute :cemetery_type, String
  attribute :name, String
  attribute :num, String

  # Alias of #num
  # @return [String] cemetery number
  #
  def id
    num
  end

  # Sort operator. Default sort should be by name ascending
  #
  # @return [Integer] -1, 0, or 1
  #
  def <=>(other)
    name <=> other.name
  end
end

#nameString

Returns name of cemetery.

Returns:

  • (String)

    name of cemetery



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/preneeds/cemetery.rb', line 16

class Cemetery < Common::Base
  attribute :cemetery_type, String
  attribute :name, String
  attribute :num, String

  # Alias of #num
  # @return [String] cemetery number
  #
  def id
    num
  end

  # Sort operator. Default sort should be by name ascending
  #
  # @return [Integer] -1, 0, or 1
  #
  def <=>(other)
    name <=> other.name
  end
end

#numString

Returns cemetery number.

Returns:

  • (String)

    cemetery number



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/preneeds/cemetery.rb', line 16

class Cemetery < Common::Base
  attribute :cemetery_type, String
  attribute :name, String
  attribute :num, String

  # Alias of #num
  # @return [String] cemetery number
  #
  def id
    num
  end

  # Sort operator. Default sort should be by name ascending
  #
  # @return [Integer] -1, 0, or 1
  #
  def <=>(other)
    name <=> other.name
  end
end

Instance Method Details

#<=>(other) ⇒ Integer

Sort operator. Default sort should be by name ascending

Returns:

  • (Integer)

    -1, 0, or 1



32
33
34
# File 'app/models/preneeds/cemetery.rb', line 32

def <=>(other)
  name <=> other.name
end

#idString

Alias of #num

Returns:

  • (String)

    cemetery number



24
25
26
# File 'app/models/preneeds/cemetery.rb', line 24

def id
  num
end