lib/poolparty/cloud.rb in auser-poolparty-1.3.11 vs lib/poolparty/cloud.rb in auser-poolparty-1.3.12

- old
+ new

@@ -237,18 +237,28 @@ # Run the monitor logic def run_monitor(monitor_name, value) mon = monitors[monitor_name.to_sym] if mon - mon.run(value.to_f) + mon.run(value) else "unhandled monitor" end end # Store the monitors in an array def monitors @monitors ||= {} + end + + def monitor_format(mon_name, meth, &block) + delayed_action do + if monitors.has_key?(mon_name) + monitors[mon_name].format(meth, &block) + else + raise PoolPartyError.create("MonitorsFormattingError", "You created a monitor format for an unknown monitor. Please check and try again!") + end + end end ##### Internal methods ##### # Methods that only the cloud itself will use # and thus are private \ No newline at end of file