Sha256: 253eea19559d0aec16d455319422558cc0d588f8d1d3c6e83ab5b91b12191df2

Contents?: true

Size: 480 Bytes

Versions: 3

Compression:

Stored size: 480 Bytes

Contents

require 'rubygems'
require 'thor/group'
require 'active_support/inflector'

module Couch
  module Generators
    class NamedBase < Base
      argument :name, :type => :string
      argument :attributes, :type => :array, :default => []

      protected

      # force underscored and singularized model name
      def model_name
        @model_name ||= name.underscore.singularize
      end

      def pluralized_model_name
        model_name.pluralize
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
couch-0.1.0 lib/couch/generators/named_base.rb
couch-0.0.4 lib/couch/generators/named_base.rb
couch-0.0.3 lib/couch/generators/named_base.rb