Module: Dcc::Base::RichContent

Included in:
V3::RichContent
Defined in:
lib/dcc/base/rich_content.rb

Overview

dcc:richContentType (v3.4+) — combines text, files, and formulae into one content block. We model it as an ordered collection of variants.

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

def self.included(klass)
  klass.class_eval do
    attribute :id, :string
    attribute :ref_id, :string
    attribute :ref_type, :string
    attribute :text, :text, collection: true
    attribute :formula, :formula, collection: true
    attribute :byte_data, :byteData, collection: true
    attribute :file, :byteData, collection: true

    xml do
      namespace ::Dcc::Namespace::Dcc
      element "richContent"
      ordered
      map_attribute "id", to: :id
      map_attribute "refId", to: :ref_id
      map_attribute "refType", to: :ref_type
      map_element "text", to: :text
      map_element "formula", to: :formula
      map_element "byteData", to: :byte_data
      map_element "file", to: :file
    end
  end
end