Class: Takagi::Message::DeduplicationCache::CacheEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/takagi/message/deduplication_cache.rb

Overview

Entry contains the cached response and metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#response_dataObject

Returns the value of attribute response_data

Returns:

  • (Object)

    the current value of response_data



16
17
18
# File 'lib/takagi/message/deduplication_cache.rb', line 16

def response_data
  @response_data
end

#source_keyObject

Returns the value of attribute source_key

Returns:

  • (Object)

    the current value of source_key



16
17
18
# File 'lib/takagi/message/deduplication_cache.rb', line 16

def source_key
  @source_key
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



16
17
18
# File 'lib/takagi/message/deduplication_cache.rb', line 16

def timestamp
  @timestamp
end

Instance Method Details

#expired?(current_time) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/takagi/message/deduplication_cache.rb', line 17

def expired?(current_time)
  current_time - timestamp > EXCHANGE_LIFETIME
end