From e5ed57cbc77b241e93942af22b1d90efcfe1267f Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sun, 21 Apr 2013 17:31:29 +0300 Subject: Run 'main' method if it exists Gives alternative, maybe less awkward way to do conditional commands. You can first use cmd methods to gather stuff you want, then in main method you could conditional to things based on them, maybe futher call methods per model. --- lib/oxidized/model/model.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/oxidized/model/model.rb') diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb index 00a520d..b768bfb 100644 --- a/lib/oxidized/model/model.rb +++ b/lib/oxidized/model/model.rb @@ -62,6 +62,7 @@ module Oxidized out = instance_exec out, &cmd_block if cmd_block data << out.to_s end + data << main.to_s if respond_to? :main data end -- cgit v1.2.1