summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-10-02 16:38:45 -0400
committerCasey Dahlin <cdahlin@redhat.com>2008-10-02 16:40:35 -0400
commit80384ed90475f21f9458783c392d9afce725ddf2 (patch)
treed4eb7d26292d89312f4a525c45ae354aeabdd866
parent2a728145218ba350ed95c7c1d93641e14884a0c2 (diff)
downloadupstate-80384ed90475f21f9458783c392d9afce725ddf2.tar.gz
upstate-80384ed90475f21f9458783c392d9afce725ddf2.tar.xz
upstate-80384ed90475f21f9458783c392d9afce725ddf2.zip
Various documentation improvements
Changed some comments and whitespace
-rw-r--r--state.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/state.rb b/state.rb
index be6b7c0..071c121 100644
--- a/state.rb
+++ b/state.rb
@@ -19,9 +19,9 @@ class State
attr :holds # Holds that are had on this state
attr :active # Are we active?
class << self
- attr :depends # What states does this state depend on?
- attr :caused_by # What events can cause this state?
- attr :rising_edge # What do we do as we're coming up?
+ attr :depends # What states does this state depend on?
+ attr :caused_by # What events can cause this state?
+ attr :rising_edge # What do we do as we're coming up?
attr :falling_edge # What do we do as we're going down?
protected
attr_writer :depends
@@ -122,7 +122,7 @@ class State
# Create a new type of state. +name+ is capitalized and postfixed with "State"
# to create the new state class name. +depends+ is a series of StatePattern
- # Objects
+ # Objects. This method is not defined in subclasses of State.
def State.new_type(name, caused_by, depends)
name = name.capitalize + "State"
raise NameError, "State already exists" if self.const_defined? name
@@ -138,7 +138,8 @@ class State
newtype
end
- # Handle the occurance of an event
+ # Handle the occurance of an event. This method is not defined in subclasses
+ # of State.
def State.process_event(event)
raise TypeError unless event.is_a? Event
count = 0
@@ -150,7 +151,8 @@ class State
count
end
- # Remove inactive states whose deps are no longer satisfied
+ # Remove inactive states whose deps are no longer satisfied. This method is
+ # not defined in subclasses of State.
def State.gc
@@states.each{ |x| x.check_deps }
nil
@@ -173,8 +175,8 @@ private
end
=begin rdoc
-A Hold is placed on a State when something has an interest in that thing being
-true. States drop automatically when they cease to have any holds on them.
+A Hold is placed on a State when something has an interest in that State being
+up. States drop automatically when they cease to have any holds on them.
=end
class Hold
def initialize #:nodoc: