Sha256: 8a23df1136bd22d03749b429b49d8ad078008026102bea3e7795833a91b526bb

Contents?: true

Size: 515 Bytes

Versions: 40

Compression:

Stored size: 515 Bytes

Contents

require 'grape-entity'

module Api
  module Entities
    class Splines < Grape::Entity
      expose :id, documentation: { type: Integer, desc: 'identity of a resource' }
      expose :x, documentation: { type: Float, desc: 'x-value' }
      expose :y, documentation: { type: Float, desc: 'y-value' }
      expose :path, documentation: { type: String, desc: 'the requested resource' }

      private

      def path
        "/#{object.class.name.demodulize.to_s.underscore}/#{object.id}"
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
grape-swagger-1.6.1 example/api/entities.rb
grape-swagger-1.6.0 example/api/entities.rb
gitlab-grape-swagger-1.5.0 example/api/entities.rb
grape-swagger-1.5.0 example/api/entities.rb
grape-swagger-1.4.2 example/api/entities.rb
grape-swagger-1.4.1 example/api/entities.rb
grape-swagger-1.4.0 example/api/entities.rb
grape-swagger-1.3.1 example/api/entities.rb
grape-swagger-1.3.0 example/api/entities.rb
grape-swagger-1.2.1 example/api/entities.rb
grape-swagger-1.2.0 example/api/entities.rb
grape-swagger-1.1.0 example/api/entities.rb
grape-swagger-1.0.0 example/api/entities.rb
grape-swagger-0.34.2 example/api/entities.rb
grape-swagger-0.34.1 example/api/entities.rb
grape-swagger-0.34.0 example/api/entities.rb
grape-swagger-0.33.0 example/api/entities.rb
grape-swagger-0.32.1 example/api/entities.rb
grape-swagger-0.32.0 example/api/entities.rb
grape-swagger-0.31.1 example/api/entities.rb