Class: ScimEngine::SchemasController

Inherits:
ApplicationController show all
Defined in:
app/controllers/scim_engine/schemas_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/scim_engine/schemas_controller.rb', line 5

def index
  schemas = ScimEngine::Engine.schemas
  schemas_by_id = schemas.reduce({}) do |hash, schema|
    hash[schema.id] = schema
    hash
  end

  render json: schemas_by_id[params[:name]] || schemas
end