Class: ScimPatchOperation

Inherits:
Object
  • Object
show all
Defined in:
app/libraries/scim_patch_operation.rb

Overview

Parse One of “Operations” in PATCH request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(op, path, value) ⇒ ScimPatchOperation

path presence is guaranteed by ScimPatchOperationConverter

value must be String or Array. complex-value(Hash) is converted to multiple single-value operations by ScimPatchOperationConverter



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/libraries/scim_patch_operation.rb', line 11

def initialize(op, path, value)
  if !op.in?(%w[add replace remove]) || path.nil?
    raise Scimaenaga::ExceptionHandler::UnsupportedPatchRequest
  end

  # define validate method in the inherited class
  validate(op, path, value)

  @op = op
  @value = value
  @path_scim = parse_path_scim(path)
  @path_sp = path_scim_to_path_sp(@path_scim)

  # define parse method in the inherited class
end

Instance Attribute Details

#opObject (readonly)

Returns the value of attribute op.



5
6
7
# File 'app/libraries/scim_patch_operation.rb', line 5

def op
  @op
end

#path_scimObject (readonly)

Returns the value of attribute path_scim.



5
6
7
# File 'app/libraries/scim_patch_operation.rb', line 5

def path_scim
  @path_scim
end

#path_spObject (readonly)

Returns the value of attribute path_sp.



5
6
7
# File 'app/libraries/scim_patch_operation.rb', line 5

def path_sp
  @path_sp
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'app/libraries/scim_patch_operation.rb', line 5

def value
  @value
end