Sha256: 10a1d558b523533879eb16bb4480ecde9a460181471d62b98086e12fe3b9c29f
Contents?: true
Size: 665 Bytes
Versions: 3
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true module ActiveTransaction module Generators # This class is responsible for generating a contract class ContractGenerator < Rails::Generators::NamedBase source_root File.expand_path("../../templates", __dir__) argument :fields, type: :array, default: [], banner: "field:type field:optional:type" def create_contract_file template "contract.rb.erb", File.join("app/contracts", class_path, "#{file_name}_contract.rb") end def create_spec_files template "contract_spec.rb.erb", File.join("spec/contracts", class_path, "#{file_name}_contract_spec.rb") end end end end
Version data entries
3 entries across 3 versions & 1 rubygems