Sha256: 1c1515b627b283f78e01a4e7cae057af1453364937845503ffe9450777a0df08

Contents?: true

Size: 461 Bytes

Versions: 3

Compression:

Stored size: 461 Bytes

Contents

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.2.0 lib/couch/generators/named_base.rb
couch-0.1.2 lib/couch/generators/named_base.rb
couch-0.1.1 lib/couch/generators/named_base.rb