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-0.31.0 example/api/entities.rb
grape-swagger-0.30.1 example/api/entities.rb
grape-swagger-0.30.0 example/api/entities.rb
grape-swagger-0.29.0 example/api/entities.rb
grape-swagger-0.28.0 example/api/entities.rb
grape-swagger-0.27.3 example/api/entities.rb
grape-swagger-0.27.2 example/api/entities.rb
grape-swagger-0.27.1 example/api/entities.rb
grape-swagger-0.27.0 example/api/entities.rb
grape-swagger-0.26.1 example/api/entities.rb
grape-swagger-0.26.0 example/api/entities.rb
grape-swagger-0.25.3 example/api/entities.rb
grape-swagger-0.25.2 example/api/entities.rb
grape-swagger-0.25.1 example/api/entities.rb
grape-swagger-0.25.0 example/api/entities.rb
grape-swagger-0.24.0 example/api/entities.rb
grape-swagger-0.23.0 example/api/entities.rb
grape-swagger-0.22.0 example/api/entities.rb
grape-swagger-0.21.0 example/api/entities.rb
grape-swagger-0.20.3 example/api/entities.rb