lib/grumlin/sugar.rb in grumlin-0.19.7 vs lib/grumlin/sugar.rb in grumlin-0.20.0

- old
+ new

@@ -4,14 +4,12 @@ module Sugar def self.included(base) base.include(Grumlin::Expressions) end - def __(shortcuts = {}) - Grumlin::TraversalStart.new(shortcuts) # TODO: allow only regular and start steps - end - - def g(shortcuts = {}) - Grumlin::TraversalStart.new(shortcuts) + %i[__ g].each do |name| + define_method name do |cuts = Shortcuts::Storage.empty| + cuts.send(name) + end end end end