Sha256: fcbf95bdeae7ed64483e16049f327fad730bfdf2ea80859587d2dcf1377eb1db

Contents?: true

Size: 796 Bytes

Versions: 3

Compression:

Stored size: 796 Bytes

Contents

module Exlibris
  module Aleph
    class Patron
      class CirculationPolicy
        attr_reader :identifier, :privileges

        def initialize(identifier, privileges)
          unless identifier.is_a?(Identifier)
            raise ArgumentError.new("Expecting #{identifier} to be a Patron::CirculationPolicy::Identifier")
          end
          unless privileges.is_a?(Privileges)
            raise ArgumentError.new("Expecting #{privileges} to be a Patron::CirculationPolicy::Privileges")
          end
          @identifier = identifier
          @privileges = privileges
        end

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

Version data entries

3 entries across 3 versions & 1 rubygems

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