Class: Castkit::Generators::Contract

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

Overview

Generator for creating Castkit contracts.

Generates a contract class and optionally a corresponding spec file. Accepts an optional list of attribute definitions in the form ‘name:type`.

Example:

$ castkit generate contract User name:string age:integer

This will generate:

  • lib/castkit/contracts/user.rb

  • spec/castkit/contracts/user_spec.rb

See Also:

Method Summary

Methods inherited from Base

component, #create_component, #create_spec, source_root