Class: ODDB::ReplaceFachinfoCommand

Inherits:
Object
  • Object
show all
Defined in:
src/command/replace_fachinfo.rb

Instance Method Summary (collapse)

Constructor Details

- (ReplaceFachinfoCommand) initialize(iksnr, pointer)

A new instance of ReplaceFachinfoCommand



6
7
8
9
# File 'src/command/replace_fachinfo.rb', line 6

def initialize(iksnr, pointer)
  @iksnr = iksnr
  @pointer = pointer
end

Instance Method Details

- (Object) execute(app)



10
11
12
13
14
15
16
17
18
19
20
21
# File 'src/command/replace_fachinfo.rb', line 10

def execute(app)
  if((registration = app.registration(@iksnr)) \
    && (fachinfo = @pointer.resolve(app)))
    old_fi = registration.fachinfo
    registration.fachinfo = fachinfo
    registration.odba_isolated_store
    if(old_fi && old_fi.empty?)
      app.delete(old_fi.pointer)
    end
    nil
  end
end