lib/finite/transition.rb in finite-0.0.1 vs lib/finite/transition.rb in finite-1.0.0
- old
+ new
@@ -1,5 +1,24 @@
module Finite
+
+ # The transition class. Represents a transition between two states
class Transition
- # some code
+
+ attr_reader :to, :from
+
+ # Create a new transition object
+ #
+ # @param opts [Hash] the options for a transition. Include :to and :from
+ def initialize(opts)
+ @from = opts[:from]
+ @to = opts[:to]
+ end
+
+ # Does this transition equal another transition?
+ #
+ # @param other [Transition] another transition
+ # @return true if they are equal false if not
+ def ==(other)
+ from == other.from and to == other.to
+ end
end
end
\ No newline at end of file