Sha256: e290e10e0ae6ae90a7bf73ea0e70a5e1117287cf3740cdeccb06b3e128f2bf60

Contents?: true

Size: 713 Bytes

Versions: 1

Compression:

Stored size: 713 Bytes

Contents

# coding: utf-8

module ONIX2
  class AddresseeIdentifier
    include Virtus.model

    attribute :addressee_id_type, Integer
    attribute :id_type_name
    attribute :id_value

    def to_xml
      AddresseeIdentifierRepresenter.new(self).to_xml
    end

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

  class AddresseeIdentifierRepresenter < Representable::Decorator
    include Representable::XML

    self.representation_wrap = :AddresseeIdentifier

    property :addressee_id_type, as: "AddresseeIDType", render_filter: ::ONIX2::Formatters::TWO_DIGITS
    property :id_type_name, as: "IDTypeName"
    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/addressee_identifier.rb