Class: ReFe::MFRelationTable

Inherits:
Object
  • Object
show all
Includes:
MethodCompletion
Defined in:
lib/refe/database.rb

Instance Method Summary collapse

Methods included from TraceUtils

#trace

Constructor Details

#initialize(mdoc, mtof_dbm, mtof_comp, fsrc) ⇒ MFRelationTable

Returns a new instance of MFRelationTable.



453
454
455
456
457
458
# File 'lib/refe/database.rb', line 453

def initialize( mdoc, mtof_dbm, mtof_comp, fsrc )
  @mdoc = mdoc
  @mtof_dbm = mtof_dbm
  @mtof_comp = mtof_comp
  @fsrc = fsrc
end

Instance Method Details

#[](method) ⇒ Object



464
465
466
467
468
469
# File 'lib/refe/database.rb', line 464

def []( method )
  c, t, m = method.split(/([\.\#])/, 2)
  f = @mtof_dbm[c + t, m] or
          raise LookupError, "cannot convert method to function: #{method}"
  @fsrc[f]
end

#[]=(method, function) ⇒ Object



471
472
473
474
475
476
# File 'lib/refe/database.rb', line 471

def []=( method, function )
  c, t, m = method.split(/([\.\#])/, 2)
  @mtof_dbm[c + t, m] = function
  @mtof_comp.add method
  function
end

#complete(c, t, m) ⇒ Object



478
479
480
# File 'lib/refe/database.rb', line 478

def complete( c, t, m )
  complete0(self, @mtof_comp, c, t, m)
end

#flushObject



460
461
462
# File 'lib/refe/database.rb', line 460

def flush
  @mtof_comp.flush
end