Define DryRunnable#dry_run?

A dry-runnable Agent can use this method to decide if it should avoid
affecting unsandboxed resources, like calling an external API that
might change any state.

Akinori MUSHA лет %!s(int64=10): %!d(string=назад)
Родитель
Сommit
40d6192070
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      app/concerns/dry_runnable.rb

+ 4 - 0
app/concerns/dry_runnable.rb

@@ -25,6 +25,10 @@ module DryRunnable
25 25
     )
26 26
   end
27 27
 
28
+  def dry_run?
29
+    is_a? Sandbox
30
+  end
31
+
28 32
   module Sandbox
29 33
     attr_accessor :results
30 34