README.md in alba-0.12.0 vs README.md in alba-0.13.0

- old
+ new

@@ -219,9 +219,41 @@ RestrictedFooResouce.new(foo).serialize # => '{"name":"my foo"}' end ``` +### Attribute key transformation + +** Note: You need to install `active_support` gem to use `transform_keys` DSL. + +With `active_support` installed, you can transform attribute keys. + +```ruby +class User + attr_reader :id, :first_name, :last_name + + def initialize(id, first_name, last_name) + @id = id + @first_name = first_name + @last_name = last_name + end +end + +class UserResource + include Alba::Resource + + attributes :id, :first_name, :last_name + + transform_keys :lower_camel +end + +user = User.new(1, 'Masafumi', 'Okura') +UserResourceCamel.new(user).serialize +# => '{"id":1,"firstName":"Masafumi","lastName":"Okura"}' +``` + +Supported transformation types are :camel, :lower_camel and :dash. + ## Comparison Alba is faster than alternatives. For a performance benchmark, see https://gist.github.com/okuramasafumi/4e375525bd3a28e4ca812d2a3b3e5829.