Class: Preneeds::AttachmentType

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

Overview

Models an attachment type 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

#attachment_type_idInteger

Returns attachment type id.

Returns:

  • (Integer)

    attachment type id



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

class AttachmentType < Common::Base
  attribute :attachment_type_id, Integer
  attribute :description, String

  # Alias for :attachment_type_id attribute
  #
  # @return [Integer] attachment type id
  #
  def id
    attachment_type_id
  end

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

#descriptionString

Returns attachment type description.

Returns:

  • (String)

    attachment type description



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

class AttachmentType < Common::Base
  attribute :attachment_type_id, Integer
  attribute :description, String

  # Alias for :attachment_type_id attribute
  #
  # @return [Integer] attachment type id
  #
  def id
    attachment_type_id
  end

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

Instance Method Details

#<=>(other) ⇒ Integer

Sort operator Default sort should be by description ascending

Returns:

  • (Integer)

    -1, 0, or 1



31
32
33
# File 'app/models/preneeds/attachment_type.rb', line 31

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

#idInteger

Alias for :attachment_type_id attribute

Returns:

  • (Integer)

    attachment type id



22
23
24
# File 'app/models/preneeds/attachment_type.rb', line 22

def id
  attachment_type_id
end