Sha256: b0b8bdc67f9df949e05039e85cffd9722874231bb4e01507b8dc717a2f9d084c

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 Bytes

Contents

class AdhocPortfolioGenerator < Rails::Generator::Base
  def initialize(runtime_args, runtime_options = {})
    super
    @name = @args.first || 'portfolio'
  end

  def manifest
    record do |m|
      m.directory 'app/model'

      m.template "portfolio.rb", "app/models/portfolio.rb"
    end
  end

  def file_name
    @name.underscore
  end

  def constant_name
    @name.underscore.upcase
  end

  protected
    def banner
      <<-EOS
Create portfolio model.

USAGE: #{$0} #{spec.name} [config_name]
EOS
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adhoc-generators-0.0.1 rails_generators/adhoc_generators/adhoc_portfolio_generator.rb