Class: IronCache::Item

Inherits:
ResponseBase show all
Defined in:
lib/iron_cache/items.rb

Instance Method Summary collapse

Methods inherited from ResponseBase

#[], #msg, #raw

Constructor Details

#initialize(messages, res) ⇒ Item

Returns a new instance of Item.


96
97
98
99
# File 'lib/iron_cache/items.rb', line 96

def initialize(messages, res)
  super(res)
  @messages = messages
end

Instance Method Details

#deleteObject


109
110
111
# File 'lib/iron_cache/items.rb', line 109

def delete
  @messages.delete(self.key, :cache_name => raw['cache'])
end

#keyObject


101
102
103
# File 'lib/iron_cache/items.rb', line 101

def key
  raw["key"]
end

#valueObject


105
106
107
# File 'lib/iron_cache/items.rb', line 105

def value
  raw["value"]
end