Class: Ezid::Session Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ezid/session.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

An EZID session

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ Session

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Session.



10
11
12
# File 'lib/ezid/session.rb', line 10

def initialize(response=nil)
  open(response) if response
end

Instance Attribute Details

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/ezid/session.rb', line 8

def cookie
  @cookie
end

Instance Method Details

#closeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/ezid/session.rb', line 22

def close
  @cookie = nil
end

#closed?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


26
27
28
# File 'lib/ezid/session.rb', line 26

def closed?
  cookie.nil?
end

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/ezid/session.rb', line 14

def inspect
  super.sub(/@cookie="[^\"]+"/, "OPEN")
end

#open(cookie) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/ezid/session.rb', line 18

def open(cookie)
  @cookie = cookie
end

#open?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


30
31
32
# File 'lib/ezid/session.rb', line 30

def open?
  !closed?
end