def add_predicate
      # Checks whether the current value matches this state
      machine.define_helper(:instance, "#{qualified_name}?") do |machine, object|
        machine.states.matches?(object, name)
      end
    end
def add_predicate
      # Checks whether the current value matches this state
      machine.define_helper(:instance, "#{qualified_name}?") do |machine, object|
        machine.states.matches?(object, name)
      end
    end
Adds a predicate method to the owner class so long as a name has
 actually been configured for the state