Sha256: 8ba495fd0c1c662c57c73acd68b43d9daa995efa1c29419091cbc53e56b7e3e5

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

require "lutaml/model"

require_relative "annotation"
require_relative "format"
require_relative "front"
require_relative "refcontent"
require_relative "series_info"

module Rfcxml
  module V3
    class Reference < Lutaml::Model::Serializable
      attribute :anchor, :string
      attribute :derived_anchor, :string
      attribute :target, :string
      # attribute :quote_title, :string, default: -> { "true" }
      attribute :quote_title, :string
      attribute :stream, :string
      attribute :front, Front
      attribute :annotation, Annotation, collection: true
      attribute :format, Format, collection: true
      attribute :refcontent, Refcontent, collection: true
      attribute :series_info, SeriesInfo, collection: true

      xml do
        root "reference", mixed: true

        map_attribute "anchor", to: :anchor
        map_attribute "derivedAnchor", to: :derived_anchor
        map_attribute "target", to: :target
        map_attribute "quoteTitle", to: :quote_title
        # map_attribute "quote-title", to: :quote_title
        map_element "stream", to: :stream
        map_element "front", to: :front
        map_element "annotation", to: :annotation
        map_element "format", to: :format
        map_element "refcontent", to: :refcontent
        map_element "seriesInfo", to: :series_info
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rfcxml-0.2.0 lib/rfcxml/v3/reference.rb