Permalink
Browse files

+ rubykaigi presentation additions

  • Loading branch information...
1 parent 1701bd0 commit f3e021836346b6e8df902863972c525a29d3eba2 @floere committed Jul 17, 2011
Showing with 6 additions and 5 deletions.
  1. +3 −3 examples/dave_dialog.rb
  2. +2 −1 examples/magic_eight_ball_dialog.rb
  3. +1 −1 lib/james/dialog_internals.rb
View
@@ -6,11 +6,11 @@
James.dialog do
- hear 'James, I am going to close you now.' => :dave
+ hear 'Open the door.' => :sorry
- state :dave do
+ state :sorry do
into do
- "I'm sorry Dave, I can't let you do that."
+ "I'm sorry Dave. I'm afraid I can't do that."
end
end
@@ -44,7 +44,8 @@ def initialize
end
hear 'Shake the eight ball' => :shake,
- 'I have a question' => :shake
+ 'I have a question' => :shake,
+ 'What do you think?' => :shake
state :shake do
hear ['Shake the eight ball', 'I have another question', 'Again']
@@ -76,7 +76,7 @@ def hear definition
# end
#
def state name, &block
- @states ||= {}
+ @states ||= {} # Move to initializer.
@states[name] ||= block if block_given?
define_method name do
state_for name

0 comments on commit f3e0218

Please sign in to comment.