Skip to content

Commit

Permalink
p.143 change method name "add_option" to "and".
Browse files Browse the repository at this point in the history
  • Loading branch information
kono committed May 22, 2010
1 parent 90db866 commit 29b79a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chapter6/Replace_Temp_with_Chain.rb
Expand Up @@ -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 #=> #<select:0x28708 @options=[1999,2000,2001,2002]>
end

0 comments on commit 29b79a3

Please sign in to comment.