examples/static/index.html in Capcode-0.8.6 vs examples/static/index.html in Capcode-0.8.7

- old
+ new

@@ -1,5 +1,24 @@ <html> +<head> + <link href="/style" media="screen" rel="Stylesheet" type="text/css" /> +</head> <body> <h1>Capcode hello !</h1> + +<p> + Code : + <pre>:::ruby +# In an object instance variable (denoted with '@'), remember a block. +def remember(&a_block) + @block = a_block +end + +# Invoke the above method, giving it a block which takes a name. +remember {|name| puts "Hello, #{name}!"} + +# When the time is right (for the object) -- call the closure! +@block.call("Jon") +# => "Hello, Jon!"</pre> +</p> </body> </html> \ No newline at end of file