Sha256: 1ea91141a0b7a13d3d889991838a7fd3618a2032c81444ff4132157d9115973e

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

module Exlibris
  module Aleph
    class Collection
      attr_reader :code, :display, :sub_library

      def initialize(code, display, sub_library)
        unless sub_library.is_a?(SubLibrary)
          raise ArgumentError.new("Expecting #{sub_library} to be an SubLibrary")
        end
        @code = code
        @display = display
        @sub_library = sub_library
      end

      def to_s
        display
      end

      def ==(other_object)
        other_object.instance_of?(self.class) && code == other_object.code &&
          sub_library == other_object.sub_library
      end
      alias_method :eql?, :==
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
exlibris-aleph-2.0.4 lib/exlibris/aleph/collection.rb
exlibris-aleph-2.0.3 lib/exlibris/aleph/collection.rb
exlibris-aleph-2.0.0 lib/exlibris/aleph/collection.rb