lotus/model — pull request #86 by jeremyf (2014-11-11 17:34:10+00:00)
Title: Adding line numbers to class_eval

Given the following:

```ruby
class MyApp::Document
include Lotus::Entity
self.attributes :title
end

MyApp::Document.new(nil)
=> NoMethodError: undefined method `[]' for nil:NilClass
(eval):2:in `initialize'
```

This error message was unhelpful as I had to go digging around for
where it could be.

The error also calls to attention another interface question. The code
I was using was as follows:

```ruby
module MyApp
class New
include Lotus::Action

def call(params = {})
@deposit = MyApp::Document.new(params[:document])
end
end
end
```

I would like to allow defaults to be passed into initialization. The
former and latter code that initializes `MyApp::Document` are very
much the same.

Drawing a comparison to `ActiveRecord::Base` initialization the
following initialization methods each work:

* `Document.new`
* `Document.new(nil)`
* `Document.new({})`