Jay Fields

jayfields.com
twitter: @thejayfields
github: jaycfields
linkedin: Jay Fields
instagram: jaycfields

Refactoring: Ruby Edition Errata

Despite our (Shane, Martin, Jay, and the copy editors) best care some errors always manage to get through. Please accept heartfelt apologies.

Errors in the first printing:

Pages 4, 8, 9, 14, 15, 16, 17, 18, 19, in the examples provided, there are references to Movie.NEW_RELEASE which should be Movie::NEW_RELEASE to properly scope/call the constant.

Page 7, penultimate paragraph, rental should be element. The rename from element to rental comes later in the chapter.

Page 8, 9, 14, 15, 16, 17, 18, 19, 22, 23, 26, 27, in the statement method, each.movie.title should be element.movie.title

Page 9, the amount_for method should have this_amount as the last line of the method. Without the additional this_amount the code can return nil when the inline if is false.

Page 29, the Customer class (UML) should contain total_charge, not charge

Page 30, in the html_statement method of the Customer class, each.movie.title should be element.movie.title

Page 36 & 37, In the UML, Movie and it's decendents should have the method charge(days_rented), not the attribute 'charge'.

Page 37, in the UML, "Childrens Price" should be "Childrens Movie".

Page 47, in the RegularPrice and ChildrensPrice classes, include Price should be include DefaultPrice

Page 53, both 'Tips' would likely be better shown without the word "Tip" - displayed simply as definitions instead.

Page 75, the table that's referenced isn't on the inside cover, but it is available online

Page 239, UML diagram has Front Suspension Mountain Bike twice.

Page 358, "having instances of A and A".. should be "A and B".

Formatting issues:

Page 17,
"this_amount" should be code highlighted twice in the first paragraph.
"element.charge" should be code highlighted once in the first paragraph.
"charge" should be code highlighted once in the second paragraph, after the code example.

Page 19, "element" should be code highlighted in the first paragraph.

Page 23, "total_amount" should be code highlighted in the final paragraph.

Page 26, "frequent_renter_points" should be code highlighted in the first paragraph.

Page 33, "charge" should be code highlighted in the final paragraph.

Page 43, "charge" and "days_rented" should be code highlighted in the final paragraph.

Page 61, there is a paragraph style quotation by Dennis DeBruler. The page layout should be adjusted to display that as a block quote.

Page 73, "how" and "when" in the second sentence of the first paragraph should be emphasized or italicized.

We would also like to thank those people who have contributed corrections: A. Lester Buck III, Bryan Donovan, Katrina Owen, Michael Stalker, Nate Bibler, Sonia Hamilton.