Module: Expressir::Model::Identifier

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/expressir/model/identifier.rb', line 4

def self.included(mod)
  # Auto-include markers - all Identifier types have id and can have remark_items and remarks
  mod.include(HasId)
  mod.include(HasRemarkItems)
  mod.include(HasRemarks)

  mod.attribute :id, :string
  mod.attribute :remarks, :string, collection: true
  mod.attribute :remark_items,
                ::Expressir::Model::Declarations::RemarkItem, collection: true
  mod.attribute :untagged_remarks, ::Expressir::Model::RemarkInfo,
                collection: true

  mod.key_value do
    map "id", to: :id
    map "remarks", to: :remarks
    map "remark_items", to: :remark_items
    map "untagged_remarks", to: :untagged_remarks
  end
end