Sha256: 5d45bd8beb613ebfdf3e2f11755b0b68ae94b6c4bef3ed7187270ecba30036d5

Contents?: true

Size: 631 Bytes

Versions: 1

Compression:

Stored size: 631 Bytes

Contents

module ONIX2
  class SalesRights
    include Virtus.model

    attribute :sales_rights_type
    attribute :rights_country
    attribute :rights_territory

    def to_xml
      SalesRightsRepresenter.new(self).to_xml
    end

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

  class SalesRightsRepresenter < Representable::Decorator
    include Representable::XML

    self.representation_wrap = :SalesRights

    property :sales_rights_type, as: "SalesRightsType"
    property :rights_country, as: "RightsCountry"
    property :rights_territory, as: "RightsTerritory"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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