Class: Kustomize::Json6902Patch::RemoveOp

Inherits:
Op
  • Object
show all
Defined in:
lib/kustomize/json_6902_patch/remove_op.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Op

#parse_lens

Constructor Details

#initialize(path:) ⇒ RemoveOp

Returns a new instance of RemoveOp.



10
11
12
# File 'lib/kustomize/json_6902_patch/remove_op.rb', line 10

def initialize(path:)
  @lens = parse_lens(path)
end

Class Method Details

.create(patch_spec) ⇒ Object



4
5
6
7
8
# File 'lib/kustomize/json_6902_patch/remove_op.rb', line 4

def self.create(patch_spec)
  new(
    path: patch_spec['path']
  )
end

Instance Method Details

#apply(rc0) ⇒ Object



14
15
16
17
# File 'lib/kustomize/json_6902_patch/remove_op.rb', line 14

def apply(rc0)
  _, rc1 = @lens.pop_in(rc0)
  rc1
end