atom_attr_accessor

Defines accessor methods for instance variables using clojure's atoms, for thread safety


License
EPL-1.0
Install
gem install atom_attr_accessor -v 0.1.1

Documentation

atom_attr_accessor

Ruby gem to provide accessor methods using clojure atoms. This lets you create Ruby classes with thread safe instance variables.

usage

require 'atom_attr_accessor'

class ThreadSafeEmployee
	atom_attr_accessor :id, :name, :salary

end

t = ThreadSafeEmployee.new
t.id = 1 # this will create a new Atom
t.id += 1 # this will invoke .reset on it
t.id # this will invoke deref on it