Class: Castkit::Generators::Contract
- 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