Where should your code to require a custom condition go? I've tried to
use 'require' in various place in my god file but they dont seem to
work. Here's my condition I've been writing its just a simple timeout
so you can have something happen every x minutes.


module God
  module Conditions
    class Timeout < PollCondition
      attr_accessor :timeout
      def initialize
        super
        self.timeout = nil
        @timeout_at = Time.now + (self.timeout*60)
      end
      def reset
        @timeout_at = Time.now + (self.timeout*60)
      end
      def test
        if Time.now > @timeout_at
          self.info("Timed out")
          return true
        else
          self.info("In bounds")
          return false
        end
      end
    end
  end
end

-- 
You received this message because you are subscribed to the Google Groups 
"god.rb" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/god-rb?hl=en.

Reply via email to