Class: ODBA::Stub

Inherits:
Object show all
Defined in:
src/util/persistence.rb,
ext/export/src/oddb_yaml.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) odba_replace(name = nil)



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'src/util/persistence.rb', line 9

def odba_replace(name=nil)
  @receiver || begin
    @receiver = ODBA.cache.fetch(@odba_id, @odba_container)
    if(@odba_container)
      @odba_container.odba_replace_stubs(self, @receiver)
    end
    @receiver
  rescue OdbaError => e
    msg = "ODBA::Stub was unable to replace #{@odba_class}:#{@odba_id} - "
    if(@odba_container.respond_to?(:pointer))
      msg << @odba_container.pointer.to_s  
    end
    names = @odba_container.instance_variables.select { |name|
      eql?(@odba_container.instance_variable_get(name))
    }
    msg << "[" << names.join(',') << "]"
    warn msg
  end
end

- (Object) to_yaml(*args)



13
14
15
# File 'ext/export/src/oddb_yaml.rb', line 13

def to_yaml(*args)
  odba_instance.to_yaml(*args)
end