Class: Jerakia::Cache::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/jerakia/cache/entry.rb

Constant Summary collapse

@@cache =
Jerakia::Cache.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key = '', _content = '') ⇒ Entry

Returns a new instance of Entry


6
7
8
# File 'lib/jerakia/cache/entry.rb', line 6

def initialize(key = '', _content = '')
  @@cache.add(key, self)
end

Instance Attribute Details

#contentObject

Returns the value of attribute content


3
4
5
# File 'lib/jerakia/cache/entry.rb', line 3

def content
  @content
end

#keyObject

Returns the value of attribute key


2
3
4
# File 'lib/jerakia/cache/entry.rb', line 2

def key
  @key
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'lib/jerakia/cache/entry.rb', line 10

def valid?
  true
end