Sha256: 6c2cfcdddc559b4f4e1abc59205b09760dc54a0899ed9d672804d19941001835

Contents?: true

Size: 359 Bytes

Versions: 50

Compression:

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

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
jsonapi-resources-0.10.7 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.6 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.5 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.4 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.9.12 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.3 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.2 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.9.11 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.1 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0.beta9 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0.beta8 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0.beta7 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0.beta6 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.9.10 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.9.9 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0.beta5 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.9.8 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.10.0.beta4 lib/generators/jsonapi/resource_generator.rb
jsonapi-resources-0.9.7 lib/generators/jsonapi/resource_generator.rb