Sha256: 2a2b5f081a4937adad1d6a276651eb4b2a3883457df3cf11ba2e14aaebea8752

Contents?: true

Size: 749 Bytes

Versions: 4

Compression:

Stored size: 749 Bytes

Contents

require 'rid/generators/named_base'

module Rid::Generators
  class ScaffoldGenerator < NamedBase
    def create_view_function
      Rid::Generators.invoke :view, *invokation_options
    end

    def inject_validations
      Rid::Generators.invoke :validation, *invokation_options
    end

    def create_list_function
      Rid::Generators.invoke :list, *invokation_options
    end

    def create_show_function
      Rid::Generators.invoke :show, *invokation_options
    end

    def create_update_function
      Rid::Generators.invoke :update, *invokation_options
    end

    protected

    # TODO: add default options, like --help, --force etc
    def invokation_options
      [[name] + attributes, { :behavior => behavior }]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rid-0.5.2 lib/rid/generators/scaffold/scaffold_generator.rb
rid-0.5.1 lib/rid/generators/scaffold/scaffold_generator.rb
rid-0.5.0 lib/rid/generators/scaffold/scaffold_generator.rb
rid-0.4.1 lib/rid/generators/scaffold/scaffold_generator.rb