Class: DeviseScim::ScimAdapter
- Inherits:
-
Object
- Object
- DeviseScim::ScimAdapter
- Defined in:
- lib/devise_scim/scim_adapter.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#scim_group ⇒ Object
readonly
Returns the value of attribute scim_group.
-
#scim_user ⇒ Object
readonly
Returns the value of attribute scim_user.
-
#tenant ⇒ Object
readonly
Returns the value of attribute tenant.
Instance Method Summary collapse
- #after_deprovision ⇒ Object
- #after_provision ⇒ Object
- #attributes_for_create ⇒ Object
- #attributes_for_update ⇒ Object
- #group_to_scim ⇒ Object
- #handle_group_create ⇒ Object
- #handle_group_destroy ⇒ Object
- #handle_group_update ⇒ Object
-
#initialize(record, scim_object, tenant: nil) ⇒ ScimAdapter
constructor
A new instance of ScimAdapter.
- #to_scim ⇒ Object
Constructor Details
#initialize(record, scim_object, tenant: nil) ⇒ ScimAdapter
Returns a new instance of ScimAdapter.
7 8 9 10 11 12 |
# File 'lib/devise_scim/scim_adapter.rb', line 7 def initialize(record, scim_object, tenant: nil) @record = record @scim_user = scim_object if scim_object.is_a?(Scim::User) @scim_group = scim_object if scim_object.is_a?(Scim::Group) @tenant = tenant end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
5 6 7 |
# File 'lib/devise_scim/scim_adapter.rb', line 5 def record @record end |
#scim_group ⇒ Object (readonly)
Returns the value of attribute scim_group.
5 6 7 |
# File 'lib/devise_scim/scim_adapter.rb', line 5 def scim_group @scim_group end |
#scim_user ⇒ Object (readonly)
Returns the value of attribute scim_user.
5 6 7 |
# File 'lib/devise_scim/scim_adapter.rb', line 5 def scim_user @scim_user end |
#tenant ⇒ Object (readonly)
Returns the value of attribute tenant.
5 6 7 |
# File 'lib/devise_scim/scim_adapter.rb', line 5 def tenant @tenant end |
Instance Method Details
#after_deprovision ⇒ Object
23 |
# File 'lib/devise_scim/scim_adapter.rb', line 23 def after_deprovision; end |
#after_provision ⇒ Object
22 |
# File 'lib/devise_scim/scim_adapter.rb', line 22 def after_provision; end |
#attributes_for_create ⇒ Object
14 15 16 |
# File 'lib/devise_scim/scim_adapter.rb', line 14 def attributes_for_create base_user_attributes end |
#attributes_for_update ⇒ Object
18 19 20 |
# File 'lib/devise_scim/scim_adapter.rb', line 18 def attributes_for_update base_user_attributes end |
#group_to_scim ⇒ Object
40 41 42 |
# File 'lib/devise_scim/scim_adapter.rb', line 40 def group_to_scim raise NotImplementedError, "#{self.class}#group_to_scim must be implemented when enable_groups is true" end |
#handle_group_create ⇒ Object
25 |
# File 'lib/devise_scim/scim_adapter.rb', line 25 def handle_group_create; end |
#handle_group_destroy ⇒ Object
27 |
# File 'lib/devise_scim/scim_adapter.rb', line 27 def handle_group_destroy; end |
#handle_group_update ⇒ Object
26 |
# File 'lib/devise_scim/scim_adapter.rb', line 26 def handle_group_update; end |
#to_scim ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/devise_scim/scim_adapter.rb', line 29 def to_scim scim = Scim::User.new scim.id = record.id.to_s scim.user_name = record.email scim.active = resolve_active scim.emails = [Scim::Email.new(value: record.email, type: "work", primary: true)] scim.name = build_name scim. = ("User") scim end |