Sha256: f59aecaf2412a4a60706d01af015a5399a966345530c77d855d2d7559f899230

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

# coding: utf-8

module ONIX2
  class Imprint
    include Virtus.model

    attribute :name_code_type, Integer
    attribute :name_code_type_name
    attribute :name_code_value
    attribute :imprint_name

    def to_xml
      ImprintRepresenter.new(self).to_xml
    end

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

  class ImprintRepresenter < Representable::Decorator
    include Representable::XML

    self.representation_wrap = :Imprint

    property :name_code_type, as: "NameCodeType", render_filter: ::ONIX2::Formatters::TWO_DIGITS
    property :name_code_type_name, as: "NameCodeTypeName"
    property :name_code_value, as: "NameCodeValue"
    property :imprint_name, as: "ImprintName"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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