lib/grumlin/repository/instance_methods.rb in grumlin-0.19.7 vs lib/grumlin/repository/instance_methods.rb in grumlin-0.20.0
- old
+ new
@@ -3,24 +3,24 @@
module Grumlin
module Repository
module InstanceMethods
include Grumlin::Expressions
+ extend Forwardable
+
UPSERT_RETRY_PARAMS = {
on: [Grumlin::AlreadyExistsError, Grumlin::ConcurrentInsertFailedError],
sleep_method: ->(n) { Async::Task.current.sleep(n) },
tries: 3,
sleep: ->(n) { (n**2) + 1 + rand }
}.freeze
DEFAULT_ERROR_HANDLING_STRATEGY = ErrorHandlingStrategy.new(mode: :retry, **UPSERT_RETRY_PARAMS)
- def __
- @__ ||= TraversalStart.new(self.class.shortcuts)
- end
+ def_delegators :shortcuts, :g, :__
- def g
- @g ||= TraversalStart.new(self.class.shortcuts)
+ def shortcuts
+ self.class.shortcuts
end
def drop_vertex(id)
g.V(id).drop.iterate
end