lib/grumlin/shortcuts.rb in grumlin-0.15.6 vs lib/grumlin/shortcuts.rb in grumlin-0.16.0

- old
+ new

@@ -1,17 +1,10 @@ # frozen_string_literal: true module Grumlin module Shortcuts - module InstanceMethods - def with_shortcuts(obj) - ShortcutProxy.new(obj, self.class.shortcuts, parent: self) - end - end - def self.extended(base) - base.include(InstanceMethods) base.include(Grumlin::Expressions) end def inherited(subclass) super @@ -19,10 +12,10 @@ end def shortcut(name, shortcut = nil, &block) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity name = name.to_sym # TODO: blocklist of names to avoid conflicts with standard methods? - if Grumlin::AnonymousStep::SUPPORTED_STEPS.include?(name) + if Grumlin::Action::REGULAR_STEPS.include?(name) raise ArgumentError, "cannot use names of standard gremlin steps" end if (shortcut.nil? && block.nil?) || (shortcut && block)