def condition(kind)
      # Create the condition.
      begin
        c = Condition.generate(kind, self.watch)
      rescue NoSuchConditionError => e
        abort e.message
      end

      # Send to block so config can set attributes.
      yield(c) if block_given?

      # Prepare the condition.
      c.prepare

      # Test generic and specific validity.
      unless Condition.valid?(c) && c.valid?
        abort "Exiting on invalid condition"
      end

      # Inherit interval from watch if no poll condition specific interval was
      # set.
      if c.kind_of?(PollCondition) && !c.interval
        if self.watch.interval
          c.interval = self.watch.interval
        else
          abort "No interval set for Condition '#{c.class.name}' in Watch " +
                "'#{self.watch.name}', and no default Watch interval from " +
                "which to inherit."
        end
      end

      # Add the condition to the list.
      self.conditions << c
    end
def condition(kind)
      # Create the condition.
      begin
        c = Condition.generate(kind, self.watch)
      rescue NoSuchConditionError => e
        abort e.message
      end

      # Send to block so config can set attributes.
      yield(c) if block_given?

      # Prepare the condition.
      c.prepare

      # Test generic and specific validity.
      unless Condition.valid?(c) && c.valid?
        abort "Exiting on invalid condition"
      end

      # Inherit interval from watch if no poll condition specific interval was
      # set.
      if c.kind_of?(PollCondition) && !c.interval
        if self.watch.interval
          c.interval = self.watch.interval
        else
          abort "No interval set for Condition '#{c.class.name}' in Watch " +
                "'#{self.watch.name}', and no default Watch interval from " +
                "which to inherit."
        end
      end

      # Add the condition to the list.
      self.conditions << c
    end
Initialize a new Metric.

 watch       - The Watch.
 destination - The optional destination Hash in canonical hash form.
 Public: Instantiate the given Condition and pass it into the optional
 block. Attributes of the condition must be set in the config file.

 kind - The Symbol name of the condition.

 Returns nothing.