Class: Exlibris::Aleph::AdminLibrary

Inherits:
Object
  • Object
show all
Defined in:
lib/exlibris/aleph/admin_library.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (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

#hashObject



22
23
24
# File 'lib/exlibris/aleph/admin_library.rb', line 22

def hash
  code.hash
end

#normalized_codeObject



13
14
15
# File 'lib/exlibris/aleph/admin_library.rb', line 13

def normalized_code
  @normalized_code ||= code.downcase
end