Repository inheritance

@mike: I'm trying to abstract core methods into a parent repository class that all of our csv repos inherit from. I have the first two working, complete with tests (sorry for the massive amount of files), but the last two I am struggling with abstracting them out into find and find_all methods that can be reused. I tried using .call(attribute), but i'm not sure that works. Luke vetoed the method_missing tactic.

the two questions I have are:
 1. how do I even play around with this? I can't exactly drop a self method into irb (and my pry foo is limited)
 2. is this the right approach? is there something else that I should be considering?
First, the standard Ruby idiom is to put the arguments after the `do` when using blocks, like this:

```ruby
@collection.find do |element|
  element.call(attribute) == attribute
end
```

Second, `#call` won't work, I don't believe. You're probably looking for `#send` which is defined on every object.

I think your `.find_by_X` method should be taking two arguments, the attribute you're looking to query on, and the value itself. It doesn't really seem to make sense to do the following, unless I'm missing something:

```ruby
Customer.find_by_X(:first_name)
```

This seems like the desired API:

```ruby
Customer.find_by_X(:first_name, 'Mike')
```

Third, this may be stylistic, but I dislike the capital X in the method name, this works just fine (for now): `.find_by_x`

Forth, the block passed to this `#find`, and body of the entire method, should probably be more like this, which I believe is what you were originally going for:

```ruby
def self.find_by_x(attribute, value)
  @collection.find do |element|
    element.send(attribute) == value
  end
end
```

Finally, you probably want to be using the `.collection` method, instead of the `@collection` class instance variable. This will ensure you always have a collection of elements, but `@collection` may not be set if you haven't called the `.collection` method.