unit uNotifyPersistent;

interface

uses
  Windows, SysUtils, Classes, Controls,
  Rubies, Pythia, uStrUtils,
  heClasses;

var
  cNotifyPersistent: Tvalue;

function ap_cNotifyPersistent: Tvalue;
procedure Init_NotifyPersistent;

implementation

function ap_cNotifyPersistent: Tvalue;
begin
  result := cNotifyPersistent;
end;

function NotifyPersistent_update(This: Tvalue): Tvalue; cdecl;
var
  real: TNotifyPersistent;
begin
  real := ap_data_get_struct(This);
  real.BeginUpdate;
  try
    result := rb_yield(Qnil);
  finally
    real.EndUpdate;
  end;
end;

procedure Init_NotifyPersistent;
begin
  cNotifyPersistent := rb_define_class_under(ap_mPhi, 'NotifyPersistent', ap_cObject);
  rb_define_method(cNotifyPersistent, 'update', @NotifyPersistent_update, 0);
end;

end.
