Sha256: 693aec475472dcc0a0c5b9e02a193d97b52c960a2fb8d9bc6a9d1d349969328c

Contents?: true

Size: 347 Bytes

Versions: 3

Compression:

Stored size: 347 Bytes

Contents

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}_resource.rb"
      )
      template 'jsonapi_resource.rb', template_file
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jsonapi-resources-0.5.7 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.5.6 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.5.5 lib/generators/jsonapi/resource_generator.rb