Last active
October 14, 2015 08:19
-
-
Save jlecour/7ff6de9ff14ca6b2cc36 to your computer and use it in GitHub Desktop.
Revisions
-
jlecour revised this gist
Oct 14, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def prelude def final if block_given? yield("world") else puts "- no block given to #final" end -
jlecour revised this gist
Oct 14, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,12 +16,12 @@ def final end end puts "# prelude with no block" prelude puts "" puts "# prelude with a block" prelude { |name| puts "Hello #{name} from prelude block" } -
jlecour created this gist
Oct 14, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ def prelude if block_given? final { |name| yield(name) } else final end end def final if block_given? yield("toto") else puts "- no block given to #final" end end puts "# prelude 1" prelude puts "" puts "# prelude 2" prelude { |name| puts "Hello #{name} from prelude block" }