Template Method その4
module TemplateMethod2 class Child def open print "<" end def disp(&block) open block.call close end def close puts ">" end end end TemplateMethod2::Child.new.disp { print "H" * 5 }
初めと意味が変わってしまいましたが、
これもTemplate Methodですよね。
module TemplateMethod2 class Child def open print "<" end def disp(&block) open block.call close end def close puts ">" end end end TemplateMethod2::Child.new.disp { print "H" * 5 }
初めと意味が変わってしまいましたが、
これもTemplate Methodですよね。