Sha256: e614227ec5eb73e0f67c2e3caf3b52ea21bd5a9ac4eecf9c9d534f5d93e8643b

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

# coding: utf-8

module ONIX2
  class SeriesIdentifier
  include Virtus.model

    attribute :series_id_type, Integer
    attribute :id_value

    def to_xml
      SeriesIdentifierRepresenter.new(self).to_xml
    end

    def self.from_xml(data)
      SeriesIdentifierRepresenter.new(self.new).from_xml(data)
    end
  end

  class SeriesIdentifierRepresenter < Representable::Decorator
    include Representable::XML

    self.representation_wrap = :SeriesIdentifier

    property :series_id_type, as: "SeriesIDType", render_filter: ::ONIX2::Formatters::TWO_DIGITS
    property :id_value, as: "IDValue"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onix2-1.0.0 lib/onix2/series_identifier.rb