Class: GCoder::Storage::HeapAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/gcoder/storage.rb

Instance Method Summary collapse

Methods inherited from Adapter

#config, #initialize

Constructor Details

This class inherits a constructor from GCoder::Storage::Adapter

Instance Method Details

#clearObject



58
59
60
# File 'lib/gcoder/storage.rb', line 58

def clear
  @heap = {}
end

#connectObject



54
55
56
# File 'lib/gcoder/storage.rb', line 54

def connect
  @heap = {}
end

#get(key) ⇒ Object



62
63
64
# File 'lib/gcoder/storage.rb', line 62

def get(key)
  @heap[nkey(key)]
end

#set(key, value) ⇒ Object



66
67
68
# File 'lib/gcoder/storage.rb', line 66

def set(key, value)
  @heap[nkey(key)] = nval(value)
end