diff --git a/chapter6/Replace_Temp_with_Chain.rb b/chapter6/Replace_Temp_with_Chain.rb index b3196ab..3220603 100644 --- a/chapter6/Replace_Temp_with_Chain.rb +++ b/chapter6/Replace_Temp_with_Chain.rb @@ -9,13 +9,13 @@ def options @options ||=[] end - def add_option(arg) + def and(arg) options << arg self end end def main_proc - select = Select.with_option(1999).add_option(2000).add_option(2001).add_option(2002) + select = Select.with_option(1999).and(2000).and(2001).and(2002) select #=> # end