Class: Aws::EndpointCache::Endpoint Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/endpoint_cache.rb

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.

Constant Summary collapse

CACHE_PERIOD =

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

default endpoint cache time, 1 minute

1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Endpoint

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 Endpoint.



177
178
179
180
181
# File 'lib/aws-sdk-core/endpoint_cache.rb', line 177

def initialize(options)
  @address = options.fetch(:address)
  @cache_period = options[:cache_period_in_minutes] || CACHE_PERIOD
  @created_time = Time.now
end

Instance Attribute Details

#addressObject (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.

String

valid URI address (with path)



184
185
186
# File 'lib/aws-sdk-core/endpoint_cache.rb', line 184

def address
  @address
end

Instance Method Details

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


186
187
188
# File 'lib/aws-sdk-core/endpoint_cache.rb', line 186

def expired?
  Time.now - @created_time > @cache_period * 60
end