Class: AFJSONPatchOperation
- Inherits:
-
Object
- Object
- AFJSONPatchOperation
- Defined in:
- lib/afmotion-rocket/AFJSONPatchOperation.rb
Constant Summary collapse
- OPERATION_NAMES =
{ AFJSONAddOperationType => 'add', AFJSONRemoveOperationType => 'remove', AFJSONReplaceOperationType => 'replace', AFJSONMoveOperationType => 'move', AFJSONCopyOperationType => 'copy', AFJSONTestOperationType => 'test' }
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/afmotion-rocket/AFJSONPatchOperation.rb', line 11 def to_h { 'op' => OPERATION_NAMES[self.type], 'path' => self.path, 'from' => self.from, 'value' => self.value }.reject {|key, value| value.nil? || value.empty?} end |