class Arbolito::Store::Memory

Public Class Methods

add(rate) click to toggle source
# File lib/arbolito/store/memory.rb, line 9
def add(rate)
  synchronize do 
    hash[rate.quote.to_hash] = rate
  end
end
clear() click to toggle source
# File lib/arbolito/store/memory.rb, line 21
def clear
  synchronize do 
    @@hash = {}
  end
end
fetch(quote) click to toggle source
# File lib/arbolito/store/memory.rb, line 15
def fetch(quote)
  synchronize do 
    hash[quote.to_hash]
  end
end
hash() click to toggle source
# File lib/arbolito/store/memory.rb, line 31
def hash
  @@hash ||= {}
end
mutex() click to toggle source
# File lib/arbolito/store/memory.rb, line 5
def mutex
  @@mutex ||= Mutex.new
end
synchronize(&block) click to toggle source
# File lib/arbolito/store/memory.rb, line 27
def synchronize(&block)
  mutex.synchronize(&block)
end