jgaskins/perpetuity — pull request #51 by reneklacan (2014-08-18 22:36:08+00:00)
Title: Detecting attributes from model

Hi, I have implemented automatic attributes detection from model, what do this about it?

Let's have a model

```ruby
class Book
include Virtus.model

attribute :title
attribute :price
attribute :description
end

# or

class Book
attr_accessor :title, :price, :description

def self.attributes
[:title, :price, :description]
end
end
```

After this change you can write mapper

```ruby
class BookMapper < Perpetuity::Mapper
map Book
detect_attributes
end
```

Instead of

```ruby
class BookMapper < Perpetuity::Mapper
map Book
attribute :title
attribute :price
attribute :description
end
```