Class: Exlibris::Aleph::Item::CirculationPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/exlibris/aleph/item/circulation_policy.rb,
lib/exlibris/aleph/item/circulation_policy/display.rb,
lib/exlibris/aleph/item/circulation_policy/identifier.rb,
lib/exlibris/aleph/item/circulation_policy/privileges.rb

Defined Under Namespace

Classes: Display, Identifier, Privileges

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier, display, privileges) ⇒ CirculationPolicy

Returns a new instance of CirculationPolicy.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/exlibris/aleph/item/circulation_policy.rb', line 7

def initialize(identifier, display, privileges)
  unless identifier.is_a?(Identifier)
    raise ArgumentError.new("Expecting #{identifier} to be a Item::CirculationPolicy::Identifier")
  end
  unless display.is_a?(Display)
    raise ArgumentError.new("Expecting #{identifier} to be a Item::CirculationPolicy::Display")
  end
  unless privileges.is_a?(Privileges)
    raise ArgumentError.new("Expecting #{privileges} to be a Item::CirculationPolicy::Privileges")
  end
  @identifier = identifier
  @display = display
  @privileges = privileges
end

Instance Attribute Details

#displayObject (readonly)

Returns the value of attribute display.



5
6
7
# File 'lib/exlibris/aleph/item/circulation_policy.rb', line 5

def display
  @display
end

#identifierObject (readonly)

Returns the value of attribute identifier.



5
6
7
# File 'lib/exlibris/aleph/item/circulation_policy.rb', line 5

def identifier
  @identifier
end

#privilegesObject (readonly)

Returns the value of attribute privileges.



5
6
7
# File 'lib/exlibris/aleph/item/circulation_policy.rb', line 5

def privileges
  @privileges
end

Instance Method Details

#==(other_object) ⇒ Object Also known as: eql?



22
23
24
25
# File 'lib/exlibris/aleph/item/circulation_policy.rb', line 22

def ==(other_object)
  (other_object.instance_of?(self.class) &&
    identifier == other_object.identifier)
end