Class: Exlibris::Aleph::AdminLibrary
- Inherits:
-
Object
- Object
- Exlibris::Aleph::AdminLibrary
- Defined in:
- lib/exlibris/aleph/admin_library.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #==(other_object) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(code) ⇒ AdminLibrary
constructor
A new instance of AdminLibrary.
- #normalized_code ⇒ Object
Constructor Details
#initialize(code) ⇒ AdminLibrary
Returns a new instance of AdminLibrary.
6 7 8 9 10 11 |
# File 'lib/exlibris/aleph/admin_library.rb', line 6 def initialize(code) unless code.is_a?(String) raise ArgumentError.new("Expecting #{code} to be a String") end @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/exlibris/aleph/admin_library.rb', line 4 def code @code end |
Instance Method Details
#==(other_object) ⇒ Object Also known as: eql?
17 18 19 |
# File 'lib/exlibris/aleph/admin_library.rb', line 17 def ==(other_object) other_object.instance_of?(self.class) && code == other_object.code end |
#hash ⇒ Object
22 23 24 |
# File 'lib/exlibris/aleph/admin_library.rb', line 22 def hash code.hash end |
#normalized_code ⇒ Object
13 14 15 |
# File 'lib/exlibris/aleph/admin_library.rb', line 13 def normalized_code @normalized_code ||= code.downcase end |