plexus / yaks

Ruby library for building hypermedia APIs
http://rubygems.org/gems/yaks
MIT License
236 stars 26 forks source link

Mapper .attribute method now accepts a block #63

Closed groyoh closed 9 years ago

groyoh commented 9 years ago

Mapper can now define attributes using a block, e.g.:

def PostMapper < Yaks::Mapper
  attribute :full_name do
    "#{object.first_name} #{object.last_name}"
  end
end

Resolves #15.

plexus commented 9 years ago

I'll let Travis finish for good measure. Also gives you some time if you like to still add something to the README, you can just push again to the same branch.

plexus commented 9 years ago

Great work! Implementation, tests, README, all look really good. One thing I forgot to mention is to update the CHANGELOG, but I tend to review things before I release a new gem so that's not a big problem.