Sha256: 7d6b1708ffe694b57f262013b3d9a71d4cd2afd15002619f801b4f6421ce1dca

Contents?: true

Size: 390 Bytes

Versions: 1

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true

module Jsonapi
  class ResourceGenerator < Rails::Generators::NamedBase
    source_root File.expand_path('../templates', __FILE__)

    def create_resource
      template_file = File.join(
        'app/resources',
        class_path,
        "#{file_name.singularize}_resource.rb"
      )
      template 'jsonapi_resource.rb', template_file
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jsonapi-resources-0.11.0.beta2 lib/generators/jsonapi/resource_generator.rb