Class: Exlibris::Aleph::Patron::CirculationPolicy
- Inherits:
-
Object
- Object
- Exlibris::Aleph::Patron::CirculationPolicy
- Defined in:
- lib/exlibris/aleph/patron/circulation_policy.rb,
lib/exlibris/aleph/patron/circulation_policy/identifier.rb,
lib/exlibris/aleph/patron/circulation_policy/privileges.rb
Defined Under Namespace
Classes: Identifier, Privileges
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#privileges ⇒ Object
readonly
Returns the value of attribute privileges.
Instance Method Summary collapse
- #==(other_object) ⇒ Object (also: #eql?)
-
#initialize(identifier, privileges) ⇒ CirculationPolicy
constructor
A new instance of CirculationPolicy.
Constructor Details
#initialize(identifier, privileges) ⇒ CirculationPolicy
Returns a new instance of CirculationPolicy.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/exlibris/aleph/patron/circulation_policy.rb', line 7 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 |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/exlibris/aleph/patron/circulation_policy.rb', line 5 def identifier @identifier end |
#privileges ⇒ Object (readonly)
Returns the value of attribute privileges.
5 6 7 |
# File 'lib/exlibris/aleph/patron/circulation_policy.rb', line 5 def privileges @privileges end |
Instance Method Details
#==(other_object) ⇒ Object Also known as: eql?
18 19 20 21 |
# File 'lib/exlibris/aleph/patron/circulation_policy.rb', line 18 def ==(other_object) (other_object.instance_of?(self.class) && identifier == other_object.identifier) end |