main
 1# frozen_string_literal: true
 2
 3module Scim
 4  module Kit
 5    module V2
 6      # Represents the valid Mutability values
 7      class Mutability
 8        READ_ONLY = 'readOnly'
 9        READ_WRITE = 'readWrite'
10        IMMUTABLE = 'immutable'
11        WRITE_ONLY = 'writeOnly'
12        VALID = {
13          immutable: IMMUTABLE,
14          readOnly: READ_ONLY,
15          readWrite: READ_WRITE,
16          read_only: READ_ONLY,
17          read_write: READ_WRITE,
18          readonly: READ_ONLY,
19          readwrite: READ_WRITE,
20          writeOnly: WRITE_ONLY,
21          write_only: WRITE_ONLY,
22          writeonly: WRITE_ONLY
23        }.freeze
24
25        def self.find(value)
26          VALID[value.to_sym] || (raise ArgumentError, :mutability)
27        end
28      end
29    end
30  end
31end