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