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



172
173
174
175
176
# File 'lib/aws-sdk-core/endpoint_cache.rb', line 172

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)



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

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.



181
182
183
# File 'lib/aws-sdk-core/endpoint_cache.rb', line 181

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