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.



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

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

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#keyObject

Returns the value of attribute key.



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

def key
  @key
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  true
end