Class: ScimEngine::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/scim_engine/engine.rb

Class Method Summary collapse

Class Method Details

.add_custom_resource(resource) ⇒ Object

Can be used to add a new resource type which is not provided by the gem.

Examples:

module Scim
  module Resources
    class ShinyResource < ScimEngine::Resources::Base
      set_schema Scim::Schema::Shiny

      def self.endpoint
        "/Shinies"
      end
    end
  end
end
ScimEngine::Engine.add_custom_resource Scim::Resources::ShinyResource

32
33
34
# File 'lib/scim_engine/engine.rb', line 32

def self.add_custom_resource(resource)
  custom_resources << resource
end

.custom_resourcesObject

Returns the list of custom resources, if any.


37
38
39
# File 'lib/scim_engine/engine.rb', line 37

def self.custom_resources
  @custom_resources ||= []
end

.default_resourcesObject

Returns the default resources added in this gem: User and Group.


42
43
44
# File 'lib/scim_engine/engine.rb', line 42

def self.default_resources
  [ Resources::User, Resources::Group ]
end

.resourcesObject


14
15
16
# File 'lib/scim_engine/engine.rb', line 14

def self.resources
  default_resources + custom_resources
end

.schemasObject


46
47
48
# File 'lib/scim_engine/engine.rb', line 46

def self.schemas
  resources.map(&:schemas).flatten.uniq.map(&:new)
end