module MemModel

Constants

PERSISTENT_ROOT
VERSION

Public Class Methods

abort() click to toggle source
# File lib/mem_model.rb, line 15
def abort
  maglev? ? Maglev.abort_transaction : true
end
commit() click to toggle source
# File lib/mem_model.rb, line 11
def commit
  maglev? ? Maglev.commit_transaction : true
end
maglev?() click to toggle source
# File lib/mem_model.rb, line 7
def maglev?
  !defined?(Maglev).nil?
end
persistent(&block) click to toggle source
# File lib/mem_model.rb, line 19
def persistent(&block)
  if maglev?
    Maglev.persistent{ block.call }
    commit
  else
    block.call
  end
end

Private Instance Methods

abort() click to toggle source
# File lib/mem_model.rb, line 15
def abort
  maglev? ? Maglev.abort_transaction : true
end
commit() click to toggle source
# File lib/mem_model.rb, line 11
def commit
  maglev? ? Maglev.commit_transaction : true
end
maglev?() click to toggle source
# File lib/mem_model.rb, line 7
def maglev?
  !defined?(Maglev).nil?
end
persistent(&block) click to toggle source
# File lib/mem_model.rb, line 19
def persistent(&block)
  if maglev?
    Maglev.persistent{ block.call }
    commit
  else
    block.call
  end
end