Sha256: cd9899d916a0312b1bf6dd74af053d8ce5d4c8dea0ebecfdcbe82194362bf6fb
Contents?: true
Size: 918 Bytes
Versions: 2
Compression:
Stored size: 918 Bytes
Contents
module Scimitar class ResourceTypesController < ApplicationController def index resource_types = Scimitar::Engine.resources.map do |resource| resource.resource_type(scim_resource_type_url(name: resource.resource_type_id)) end render json: { schemas: [ 'urn:ietf:params:scim:api:messages:2.0:ListResponse' ], totalResults: resource_types.size, Resources: resource_types } end def show resource_types = Scimitar::Engine.resources.reduce({}) do |hash, resource| hash[resource.resource_type_id] = resource.resource_type(scim_resource_type_url(name: resource.resource_type_id)) hash end resource_type = resource_types[params[:name]] if resource_type.nil? raise Scimitar::NotFoundError.new(params[:name]) else render json: resource_type end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
scimitar-1.11.0 | app/controllers/scimitar/resource_types_controller.rb |
scimitar-2.10.0 | app/controllers/scimitar/resource_types_controller.rb |