Skip to content

Commit

Permalink
p.159 offeces;after refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
kono committed May 30, 2010
1 parent 6fa4b1a commit bed2ca7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions chapter6/Replace_Loop_with_Collection_Closure_Method.rb
Expand Up @@ -21,7 +21,5 @@ def test_proc(employees)
end

def office_proc(employees)
offices = []
employees.each{|e| offices << e.office}
return offices
offices = employees.collect{|e| e.office}
end
2 changes: 1 addition & 1 deletion chapter6/TC_Replace_Loop_with_Collection_Closure_Method.rb
Expand Up @@ -36,7 +36,7 @@ def assert(status,msg)
office_ar= office_proc(employees)
assert_not_nil(office_ar.index("Japan"))
assert_not_nil(office_ar.index("USA"))

end

end

0 comments on commit bed2ca7

Please sign in to comment.