Module: Dcc::Si::Base::SiList

Included in:
V1::SiList, V2::SiList
Defined in:
lib/dcc/si/base/si_list.rb

Overview

si:listType — recursive list container for nested quantity lists.

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



8
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
# File 'lib/dcc/si/base/si_list.rb', line 8

def self.included(klass)
  klass.class_eval do
    attribute :id, :string
    attribute :ref_type, :string
    attribute :label, :string
    attribute :date_time, :date_time
    attribute :real_list, :real, collection: true
    attribute :real_list_xml_list, :realListXMLList, collection: true
    attribute :complex_list_xml_list, :complexListXMLList, collection: true
    attribute :list, :list, collection: true

    xml do
      namespace ::Dcc::Namespace::Si
      element "list"
      ordered
      map_attribute "id", to: :id
      map_attribute "refType", to: :ref_type
      map_element "label", to: :label
      map_element "dateTime", to: :date_time
      map_element "realList", to: :real_list
      map_element "realListXMLList", to: :real_list_xml_list
      map_element "complexListXMLList", to: :complex_list_xml_list
      map_element "list", to: :list
    end
  end
end