def read(object, attribute, ivar = false)
      attribute = self.attribute(attribute)
      if ivar
        object.instance_variable_defined?("@#{attribute}") ? object.instance_variable_get("@#{attribute}") : nil
      else
        object.send(attribute)
      end
    end
def read(object, attribute, ivar = false)
      attribute = self.attribute(attribute)
      if ivar
        object.instance_variable_defined?("@#{attribute}") ? object.instance_variable_get("@#{attribute}") : nil
      else
        object.send(attribute)
      end
    end
Gets the current value stored in the given object's attribute.

 For example,

   class Vehicle
     state_machine :initial => :parked do
       ...
     end
   end

   vehicle = Vehicle.new                           # => #<Vehicle:0xb7d94ab0 @state="parked">
   Vehicle.state_machine.read(vehicle, :state)     # => "parked" # Equivalent to vehicle.state
   Vehicle.state_machine.read(vehicle, :event)     # => nil      # Equivalent to vehicle.state_event