Class: Castkit::Generators::Type

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

Overview

Generator for creating a new Castkit type.

Types define custom deserialization, serialization, and validation behavior for attributes used in Castkit::DataObject or Castkit::Contract.

Example usage:

$ castkit generate type Money

Generates:

  • lib/castkit/types/money.rb

  • spec/castkit/types/money_spec.rb

These files scaffold a Castkit::Types::Money class inheriting from Castkit::Types::Base, along with a basic RSpec test suite.

See Also:

Method Summary

Methods inherited from Base

component, #create_component, #create_spec, source_root