v0.5.8
Changes:
Optional attributes: #117
class PersonSerializer
include RestPack::Serializer
attributes :id, :name
optional :description
end
By default, description
won't be serialized. To force inclusion:
PersonSerializer.as_json(album, { include_description?: true })
Hash models: #118
Previously RestPack::Serializer
only supported objects as models. If your models are a Hash
, there is not longer any need for serializer methods such as:
def name
@model[:name]
end