Browse Source

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 10 years ago
parent
commit
40d6192070
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/concerns/dry_runnable.rb

+ 4 - 0
app/concerns/dry_runnable.rb

@@ -25,6 +25,10 @@ module DryRunnable
     )
   end
 
+  def dry_run?
+    is_a? Sandbox
+  end
+
   module Sandbox
     attr_accessor :results