Sha256: 95ea9eb82b056e7c1340c3e16d6fb2305d35496c9d58891f32c5283a44cbcd5b

Contents?: true

Size: 1.12 KB

Versions: 23

Compression:

Stored size: 1.12 KB

Contents

# encoding: utf-8
require 'virtus'

module Libis
  module Services
    module Rosetta

      class CollectionInfo
        # noinspection RubyResolve
        include Virtus.model

        class MetaData
          # noinspection RubyResolve
          include Virtus.model

          attribute :mid, String
          attribute :type, String
          attribute :sub_type, String
          attribute :content, String
        end

        attribute :id, String
        attribute :name, String
        attribute :parent_id, String
        attribute :collection_order, Integer
        attribute :description, String
        attribute :md_dc, MetaData
        attribute :md_source, Array[MetaData]
        attribute :navigate, Boolean
        attribute :publish, Boolean
        attribute :thumbnail, String
        attribute :external_id, String
        attribute :external_system, String

        def to_hash
          result = self.attributes
          result[:md_dc] = result[:md_dc].attributes if result[:md_dc]
          result[:md_source] = result[:md_source].map { |md| md.attributes }
          result
        end

      end

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
libis-services-0.1.11 lib/libis/services/rosetta/collection_info.rb
libis-services-0.1.10 lib/libis/services/rosetta/collection_info.rb
libis-services-0.1.9 lib/libis/services/rosetta/collection_info.rb