2008-01-24から1日間の記事一覧
1つめのサンプルを、単純に移植。 module TemplateMethod class AbstractDisplay def disp open 5.times { _print } close end end class CharDisplay < AbstractDisplay def initialize(str) @str = str end def open print "<" end def _print print @str …
1つめのサンプルを、単純に移植。 module TemplateMethod class AbstractDisplay def disp open 5.times { _print } close end end class CharDisplay < AbstractDisplay def initialize(str) @str = str end def open print "<" end def _print print @str …