Class: Exlibris::Aleph::Item::CirculationPolicy::Identifier

Inherits:
Object
  • Object
show all
Defined in:
lib/exlibris/aleph/item/circulation_policy/identifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, processing_status, sub_library) ⇒ Identifier

Returns a new instance of Identifier.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/exlibris/aleph/item/circulation_policy/identifier.rb', line 8

def initialize(status, processing_status, sub_library)
  unless status.is_a?(Status)
    raise ArgumentError.new("Expecting #{status} to be a Item::Status")
  end
  unless processing_status.is_a?(ProcessingStatus)
    raise ArgumentError.new("Expecting #{processing_status} to be a Item::ProcessingStatus")
  end
  unless sub_library.is_a?(SubLibrary)
    raise ArgumentError.new("Expecting #{sub_library} to be a SubLibrary")
  end
  @status = status
  @processing_status = processing_status
  @sub_library = sub_library
end

Instance Attribute Details

#processing_statusObject (readonly)

Returns the value of attribute processing_status.



6
7
8
# File 'lib/exlibris/aleph/item/circulation_policy/identifier.rb', line 6

def processing_status
  @processing_status
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/exlibris/aleph/item/circulation_policy/identifier.rb', line 6

def status
  @status
end

#sub_libraryObject (readonly)

Returns the value of attribute sub_library.



6
7
8
# File 'lib/exlibris/aleph/item/circulation_policy/identifier.rb', line 6

def sub_library
  @sub_library
end

Instance Method Details

#==(other_object) ⇒ Object Also known as: eql?



23
24
25
26
27
28
# File 'lib/exlibris/aleph/item/circulation_policy/identifier.rb', line 23

def ==(other_object)
  (other_object.instance_of?(self.class) &&
    status == other_object.status &&
    processing_status == other_object.processing_status && 
    sub_library == other_object.sub_library)
end