Class: Castkit::Generators::Serializer

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/serializer.rb

Overview

Generator for creating a custom Castkit serializer.

Serializers inherit from ‘Castkit::Serializers::Base` and define a custom `#call` method for rendering a `Castkit::DataObject` into a hash representation.

Example usage:

$ castkit generate serializer Custom

Generates:

  • lib/castkit/serializers/custom.rb

  • spec/castkit/serializers/custom_spec.rb

These files scaffold a ‘Castkit::Serializers::Custom` serializer with the correct base class.

See Also:

Method Summary

Methods inherited from Base

component, #create_component, #create_spec, source_root