acts_as_list refactoring part 3

In this article I’m continuing refactoring acts_as_list gem I started in part 2 and part 1. You don’t need to read either part to understand this article. acts_as_list is a Rails gem. It allows you to treat Rails model records as part of an ordered list and offers methods like #move_to_bottom and #move_higher. In this refactoring adventure I’m going to focus on just one 11-line method, and surprisingly, there’s a lot of things that can be improved in just

Continue Reading

CreateSend refactoring part 2

Today I’m continuing to refactor a library called CreateSend. The first part is here. In part 1 I’ve finished all class methods of Base classs and now I’m going to refactor instance methods. Step 1: initialize method initialize (see above ↑) chooses not to use named arguments, and treats method arguments as an array of many arguments. And yet, it only processes one argument from the whole args array. It’s misleading to accept arguments and throw them away. It

Continue Reading

Site Footer

Web Analytics