Module: Dcc::Base::AdministrativeData

Included in:
V2::AdministrativeData, V3::AdministrativeData
Defined in:
lib/dcc/base/administrative_data.rb

Overview

dcc:administrativeDataType — top-level admin section. Uses xs:all ordering (children may appear in any order) so we keep the explicit ordered for serialization determinism.

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/dcc/base/administrative_data.rb', line 9

def self.included(klass)
  klass.class_eval do
    attribute :id, :string
    attribute :ref_id, :string
    attribute :ref_type, :string
    attribute :dcc_software, :softwareList
    attribute :ref_type_definitions, :refTypeDefinitions
    attribute :core_data, :coreData
    attribute :items, :items
    attribute :calibration_laboratory, :calibrationLaboratory
    attribute :resp_persons, :respPersons
    attribute :customer, :contact
    attribute :statements, :statements

    xml do
      namespace ::Dcc::Namespace::Dcc
      element "administrativeData"
      ordered
      map_attribute "id", to: :id
      map_attribute "refId", to: :ref_id
      map_attribute "refType", to: :ref_type
      map_element "dccSoftware", to: :dcc_software
      map_element "refTypeDefinitions", to: :ref_type_definitions
      map_element "coreData", to: :core_data
      map_element "items", to: :items
      map_element "calibrationLaboratory", to: :calibration_laboratory
      map_element "respPersons", to: :resp_persons
      map_element "customer", to: :customer
      map_element "statements", to: :statements
    end
  end
end