Class: RVC::MemorySession

Inherits:
Object
  • Object
show all
Defined in:
lib/rvc/memory_session.rb

Instance Method Summary collapse

Constructor Details

#initializeMemorySession

Returns a new instance of MemorySession.



4
5
6
7
# File 'lib/rvc/memory_session.rb', line 4

def initialize
  @marks = {}
  @connections = {}
end

Instance Method Details

#connectionsObject



26
27
28
# File 'lib/rvc/memory_session.rb', line 26

def connections
  @connections.keys
end

#get_connection(key) ⇒ Object



30
31
32
# File 'lib/rvc/memory_session.rb', line 30

def get_connection key
  @connections[key]
end

#get_mark(key) ⇒ Object



13
14
15
# File 'lib/rvc/memory_session.rb', line 13

def get_mark key
  @marks[key]
end

#marksObject



9
10
11
# File 'lib/rvc/memory_session.rb', line 9

def marks
  @marks.keys
end

#set_connection(key, conn) ⇒ Object



34
35
36
# File 'lib/rvc/memory_session.rb', line 34

def set_connection key, conn
  @connections[key] = conn
end

#set_mark(key, objs) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/rvc/memory_session.rb', line 17

def set_mark key, objs
  if objs == nil
    @marks.delete key
  else
    fail "not an array" unless objs.is_a? Array
    @marks[key] = objs
  end
end