Sha256: d715678a4820559bd5757f8931a63d10f65b3d49b578de2b7d695834f80359f6

Contents?: true

Size: 453 Bytes

Versions: 13

Compression:

Stored size: 453 Bytes

Contents

require "godmin/generators/base"

module Godmin
  module Generators
    class NamedBase < Base
      argument :name, type: :string

      private

      def class_name
        @class_name ||= name.classify
      end

      def class_path
        @class_path ||= namespaced_path + name.classify.deconstantize.split("::").map(&:underscore)
      end

      def file_name
        @file_name ||= class_name.demodulize.underscore
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
godmin-1.0.0 lib/godmin/generators/named_base.rb
godmin-0.12.4 lib/godmin/generators/named_base.rb
godmin-0.12.3 lib/godmin/generators/named_base.rb
godmin-0.12.2 lib/godmin/generators/named_base.rb
godmin-0.12.1 lib/godmin/generators/named_base.rb
godmin-0.12.0 lib/godmin/generators/named_base.rb
godmin-0.11.2 lib/godmin/generators/named_base.rb
godmin-0.11.1 lib/godmin/generators/named_base.rb
godmin-0.11.0 lib/godmin/generators/named_base.rb
godmin-0.10.3 lib/godmin/generators/named_base.rb
godmin-0.10.2 lib/godmin/generators/named_base.rb
godmin-0.10.1 lib/godmin/generators/named_base.rb
godmin-0.10.0 lib/godmin/generators/named_base.rb