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