Module: Readapt::References

Defined in:
lib/readapt/references.rb

Class Method Summary collapse

Class Method Details

.clearObject



9
10
11
12
13
# File 'lib/readapt/references.rb', line 9

def clear
  @variable_reference_map.clear
  @reference_variable_map.clear
  @reference_id = 1000
end

.get(id) ⇒ Object



23
24
25
# File 'lib/readapt/references.rb', line 23

def get id
  @reference_variable_map[id]
end

.identify(object) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/readapt/references.rb', line 15

def identify object
  return @variable_reference_map[object] if @variable_reference_map.has_key?(object)
  @reference_id += 1
  @variable_reference_map[object] = @reference_id
  @reference_variable_map[@reference_id] = object
  @reference_id
end