lib/grumlin/traversal_start.rb in grumlin-0.21.0 vs lib/grumlin/traversal_start.rb in grumlin-0.21.1
- old
+ new
@@ -2,9 +2,18 @@
module Grumlin
class TraversalStart < Steppable
include WithExtension
+ class TraversalError < Grumlin::Error; end
+ class AlreadyBoundToTransationError < TraversalError; end
+
+ def tx
+ raise AlreadyBoundToTransationError if @session_id
+
+ Transaction.new(self.class, pool: @pool)
+ end
+
def to_s(*)
self.class.to_s
end
def inspect