Sha256: afbac0e069a769c29cd4ebdbd41ca2ad04077c74ce251e1a470953ce744afaa1

Contents?: true

Size: 1.33 KB

Versions: 31

Compression:

Stored size: 1.33 KB

Contents

# coding: utf-8

require_relative 'connector'

module Libis
  module Services
    module CollectiveAccess

      class Cataloguing < Connector

        def initialize(host = nil)
          super 'Cataloguing', host
        end

        def add_item(fields, type = nil)
          type ||= 'ca_objects'
          r, a = soap_encode fields
          request :add, type: type, fieldInfo: r, :attributes! => {fieldInfo: a}
        end

        def add_attributes(item, data, type = nil)
          type ||= 'ca_objects'
          r, a = soap_encode data
          request :getAttributesByElement, type: type, item_id: item, attribute_code_or_id: attribute.to_s, attribute_list_array: r, :attributes! => {attribute_list_array: a}

        end

        def add_attribute(item, attribute, data, type = nil)
          type ||= 'ca_objects'
          r, a = soap_encode data
          request :addAttribute, type: type, item_id: item, attribute_code_or_id: attribute.to_s, attribute_data_array: r, :attributes! => {attribute_data_array: a}
        end

        def remove(item, type = nil)
          type ||= 'ca_objects'
          request :remove, type: type, item_id: item
        end

        def remove_attributes(item, type = nil)
          type ||= 'ca_objects'
          request :removeAllAttributes, type: type, item_id: item
        end

      end

    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
libis-services-1.1.0 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.13 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.12 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.11 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.10 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.7 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.6 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.5 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.2 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.1 lib/libis/services/collective_access/cataloguing.rb
libis-services-1.0.0 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.2.1 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.2.0 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.18 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.17 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.16 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.15 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.14 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.13 lib/libis/services/collective_access/cataloguing.rb
libis-services-0.1.12 lib/libis/services/collective_access/cataloguing.rb