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(cookie = 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.



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

def initialize(cookie=nil)
  open(cookie) if cookie
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.



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

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.



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

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)


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

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.



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

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.



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

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)


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

def open?
  !closed?
end