Created
February 17, 2012 12:23
-
-
Save ashbb/1853092 to your computer and use it in GitHub Desktop.
A small sample snippet to use Shoes.url.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PhotoFrame < Shoes | |
| url '/', :index | |
| url '/a', :a | |
| url '/b', :b | |
| url '/c', :c | |
| def index | |
| a | |
| end | |
| def a | |
| para 'This is a. Go to b after 3sec' | |
| timer(3){visit '/b'} | |
| end | |
| def b | |
| para 'This is b. Go to c if you press space bar.' | |
| keypress{|k| visit '/c' if k == ' '} | |
| end | |
| def c | |
| para 'This is c. Go back a if you press space bar.' | |
| keypress{|k| visit '/a' if k == ' '} | |
| end | |
| end | |
| Shoes.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment