Sha256: daf95092bd70a831bbfc4b11e3a3dcbdc1bcb04436dadc545bfc5796c082e8cf

Contents?: true

Size: 592 Bytes

Versions: 3

Compression:

Stored size: 592 Bytes

Contents

class BasePresenter
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)
      argument :model_name, :type => :string, :default => "example"
      def generate_install
        copy_file "application_presenter.rb", "app/presenters/application_presenter.rb"
        create_file "app/presenters/#{model_name.underscore}_presenter.rb", <<-FILE
class #{model_name.classify}Presenter < ApplicationPresenter
  presents :#{model_name.underscore.split("/").last}

  # delegete :name
end
FILE
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
base_presenter-0.1.0 lib/generators/base_presenter/install/install_generator.rb
base_presenter-0.0.10 lib/generators/base_presenter/install/install_generator.rb
base_presenter-0.0.9 lib/generators/base_presenter/install/install_generator.rb