Sha256: 5583b0da8449725b4b722a213e5e3772f0c94857d406d6956151efe19050fc18

Contents?: true

Size: 616 Bytes

Versions: 7

Compression:

Stored size: 616 Bytes

Contents

class Dummy::CompanyAPI < IntrospectiveGrape::API
  paginate

  restful Company, [:id, :name, :short_name, :gizmos, :widgets, :sprockets] do

    desc "Test default values in an extra endpoint"
    params do
      optional :boolean_default, type: Boolean, default: false
      optional :string_default, type: String, default: "foo"
      optional :integer_default, type: Integer, default: 123
    end
    get '/special/list' do
      authorize Company.new, :index?
      present params
    end
    
  end

  class CompanyEntity < Grape::Entity
    expose :id, :name, :short_name, :created_at, :updated_at
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
introspective_grape-0.3.2 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.3.1 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.3.0 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.2.9 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.2.8 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.2.7 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.2.6 spec/dummy/app/api/dummy/company_api.rb