lib/bliss/constraint.rb
def run!(hash=nil)
      @state = :not_checked
      #@field.each do |field|
        #if @state == :passed
        #  break
        #end
        case @setting
          when :tag_name_required, :tag_name_suggested
            content = nil
            if hash
              #puts "#{@depth.inspect} - required: #{required.inspect}"

              found = false
              self.tag_names.each do |key|
                if hash.keys.include?(key)
                  found = true
                  break
                end
              end
              if found
                @state = :passed
              else
                if @setting == :tag_name_required
                  #puts "hash: #{hash.inspect}"
                  #puts "self.tag_names: #{self.tag_names.inspect}"
                  @state = :not_passed
                end
              end
            else
              @state = :passed
            end
          when :content_values
            if hash
              found = false
              self.tag_names.each do |key|
                content = hash[key]
                #puts content
                #puts @possible_values.inspect
                if @possible_values.include?(content)
                  found = true
                  break
                end
              end
              if found
                @state = :passed
              else
                @state = :not_passed
              end
            end
          #when :not_blank
          #  if hash.has_key?(field) and !hash[field].to_s.empty?
          #    @state = :passed
          #  else
          #    @state = :not_passed
          #  end
        end
      #end
      @state
    end
def run!(hash=nil)
      @state = :not_checked
      #@field.each do |field|
        #if @state == :passed
        #  break
        #end
        case @setting
          when :tag_name_required, :tag_name_suggested
            content = nil
            if hash
              #puts "#{@depth.inspect} - required: #{required.inspect}"

              found = false
              self.tag_names.each do |key|
                if hash.keys.include?(key)
                  found = true
                  break
                end
              end
              if found
                @state = :passed
              else
                if @setting == :tag_name_required
                  #puts "hash: #{hash.inspect}"
                  #puts "self.tag_names: #{self.tag_names.inspect}"
                  @state = :not_passed
                end
              end
            else
              @state = :passed
            end
          when :content_values
            if hash
              found = false
              self.tag_names.each do |key|
                content = hash[key]
                #puts content
                #puts @possible_values.inspect
                if @possible_values.include?(content)
                  found = true
                  break
                end
              end
              if found
                @state = :passed
              else
                @state = :not_passed
              end
            end
          #when :not_blank
          #  if hash.has_key?(field) and !hash[field].to_s.empty?
          #    @state = :passed
          #  else
          #    @state = :not_passed
          #  end
        end
      #end
      @state
    end
TODO should exist another method passed! for tag_name_required ?