class Serega
Parent class of serializers. A serializer lists attributes and serializes objects to Hashes, JSON, Data or Struct objects:
class UserSerializer < Serega attribute :first_name attribute :email, hide: true end UserSerializer.to_h(user) # => {first_name: "Bruce"} UserSerializer.to_h(user, with: :email) # => {first_name: "Bruce", email: "bruce@wayne.com"}
See the guides.
Constants
- VERSION
-
Version of the gem