Class: Rotary::Storage::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/rotary/storage/memory.rb

Instance Method Summary collapse

Constructor Details

#initializeMemory

Returns a new instance of Memory.



4
5
6
# File 'lib/rotary/storage/memory.rb', line 4

def initialize(*)
  clear
end

Instance Method Details

#clearObject



21
22
23
# File 'lib/rotary/storage/memory.rb', line 21

def clear
  @storage = []
end

#popObject



13
14
15
# File 'lib/rotary/storage/memory.rb', line 13

def pop
  @storage.pop
end

#push(session) ⇒ Object



8
9
10
11
# File 'lib/rotary/storage/memory.rb', line 8

def push(session)
  @storage.unshift(session)
  self
end

#sizeObject



17
18
19
# File 'lib/rotary/storage/memory.rb', line 17

def size
  @storage.size
end