Sha256: ce7b88c41e8be87530a856d4c99888153f2b32049d6bd432f73036d6f22019a7

Contents?: true

Size: 428 Bytes

Versions: 24

Compression:

Stored size: 428 Bytes

Contents

module Ezid
  #
  # An EZID session
  #
  # @api private
  #
  class Session

    attr_reader :cookie

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

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

    def open(cookie)
      @cookie = cookie
    end

    def close
      @cookie = nil
    end

    def closed?
      cookie.nil?
    end

    def open?
      !closed?
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ezid-client-1.10.0 lib/ezid/session.rb
ezid-client-1.9.4 lib/ezid/session.rb
ezid-client-1.9.3 lib/ezid/session.rb
ezid-client-1.9.2 lib/ezid/session.rb
ezid-client-1.9.1 lib/ezid/session.rb
ezid-client-1.9.0 lib/ezid/session.rb
ezid-client-1.9.0.rc1 lib/ezid/session.rb
ezid-client-1.8.0 lib/ezid/session.rb
ezid-client-1.7.1 lib/ezid/session.rb
ezid-client-1.7.0 lib/ezid/session.rb
ezid-client-1.6.0 lib/ezid/session.rb
ezid-client-1.5.0 lib/ezid/session.rb
ezid-client-1.4.3 lib/ezid/session.rb
ezid-client-1.4.2 lib/ezid/session.rb
ezid-client-1.4.1 lib/ezid/session.rb
ezid-client-1.4.0 lib/ezid/session.rb
ezid-client-1.3.0 lib/ezid/session.rb
ezid-client-1.2.0 lib/ezid/session.rb
ezid-client-1.1.1 lib/ezid/session.rb
ezid-client-1.1.0 lib/ezid/session.rb