def method_missing(method, *args)
      if (method.to_s =~ /^(.+)(\?|\!)$/)
        value_name = $1.to_sym
        if @state.states.has_key?(value_name)
          case $2
          when '?'
            self.class.class_eval <<-EOC
              def #{method}
                self == #{value_name.inspect}
              end
            EOC
            # Calling `method` on ourselves fails. Something to do
            # w/subclasses. Meh.
            return self == value_name
          when '!'
            self.class.class_eval <<-EOC
              def #{method}
                self.set_value(#{value_name.inspect})
              end
            EOC
            # Calling `method` on ourselves fails. Something to do w/subclasses. Meh.
            return self.set_value(value_name)
          end
        elsif $2 == '?' && aggregates = @state.aggregates[value_name]
          self.class.class_eval <<-EOC
            def #{method}
              @state.aggregates[#{value_name.inspect}].include?(@value)
            end
          EOC
          return aggregates.include?(@value)
        else
          super
        end
      elsif value_for(@value).respond_to?(method)
        value_for(@value).send(method, *args)
      else
        super
      end
    end
def method_missing(method, *args)
      if (method.to_s =~ /^(.+)(\?|\!)$/)
        value_name = $1.to_sym
        if @state.states.has_key?(value_name)
          case $2
          when '?'
            self.class.class_eval <<-EOC
              def #{method}
                self == #{value_name.inspect}
              end
            EOC
            # Calling `method` on ourselves fails. Something to do
            # w/subclasses. Meh.
            return self == value_name
          when '!'
            self.class.class_eval <<-EOC
              def #{method}
                self.set_value(#{value_name.inspect})
              end
            EOC
            # Calling `method` on ourselves fails. Something to do w/subclasses. Meh.
            return self.set_value(value_name)
          end
        elsif $2 == '?' && aggregates = @state.aggregates[value_name]
          self.class.class_eval <<-EOC
            def #{method}
              @state.aggregates[#{value_name.inspect}].include?(@value)
            end
          EOC
          return aggregates.include?(@value)
        else
          super
        end
      elsif value_for(@value).respond_to?(method)
        value_for(@value).send(method, *args)
      else
        super
      end
    end
TODO: Sweet god, this is hideous and needs to be cleaned up!