Class: Exlibris::Aleph::Patron::CirculationPolicy::Identifier
- Inherits:
-
Object
- Object
- Exlibris::Aleph::Patron::CirculationPolicy::Identifier
- Defined in:
- lib/exlibris/aleph/patron/circulation_policy/identifier.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#sub_library ⇒ Object
readonly
Returns the value of attribute sub_library.
Instance Method Summary collapse
- #==(other_object) ⇒ Object (also: #eql?)
-
#initialize(status, sub_library) ⇒ Identifier
constructor
A new instance of Identifier.
Constructor Details
#initialize(status, sub_library) ⇒ Identifier
Returns a new instance of Identifier.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/exlibris/aleph/patron/circulation_policy/identifier.rb', line 8 def initialize(status, sub_library) unless status.is_a?(Status) raise ArgumentError.new("Expecting #{status} to be a Patron::Status") end unless sub_library.is_a?(SubLibrary) raise ArgumentError.new("Expecting #{sub_library} to be a SubLibrary") end @status = status @sub_library = sub_library end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/exlibris/aleph/patron/circulation_policy/identifier.rb', line 6 def status @status end |
#sub_library ⇒ Object (readonly)
Returns the value of attribute sub_library.
6 7 8 |
# File 'lib/exlibris/aleph/patron/circulation_policy/identifier.rb', line 6 def sub_library @sub_library end |
Instance Method Details
#==(other_object) ⇒ Object Also known as: eql?
19 20 21 22 23 |
# File 'lib/exlibris/aleph/patron/circulation_policy/identifier.rb', line 19 def ==(other_object) (other_object.instance_of?(self.class) && status == other_object.status && sub_library == other_object.sub_library) end |