def define_state_predicate
      call_super = !!owner_class_ancestor_has_method?(:instance, "#{name}?")
      define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
          def #{name}?(*args)
            args.empty? && (#{call_super} || defined?(super)) ? super : self.class.state_machine(#{name.inspect}).states.matches?(self, *args)
          end
      end_eval
    end
def define_state_predicate
      call_super = !!owner_class_ancestor_has_method?(:instance, "#{name}?")
      define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
          def #{name}?(*args)
            args.empty? && (#{call_super} || defined?(super)) ? super : self.class.state_machine(#{name.inspect}).states.matches?(self, *args)
          end
      end_eval
    end
Adds predicate method to the owner class for determining the name of the
 current state