Class: Puppet::Network::HTTP::Session Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/network/http/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 HTTP session that references a persistent HTTP connection and an expiration time for the connection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, expiration_time) ⇒ 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.



9
10
11
12
# File 'lib/puppet/network/http/session.rb', line 9

def initialize(connection, expiration_time)
  @connection = connection
  @expiration_time = expiration_time
end

Instance Attribute Details

#connectionObject (readonly)

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.



7
8
9
# File 'lib/puppet/network/http/session.rb', line 7

def connection
  @connection
end

Instance Method Details

#expired?(now) ⇒ 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)


14
15
16
# File 'lib/puppet/network/http/session.rb', line 14

def expired?(now)
  @expiration_time <= now
end