Class: ODDB::MedData::DetailWriter

Inherits:
NullWriter show all
Defined in:
ext/meddata/src/meddparser.rb

Instance Method Summary (collapse)

Methods inherited from NullWriter

#new_fonthandler, #new_linkhandler, #send_image, #send_meta

Constructor Details

- (DetailWriter) initialize

A new instance of DetailWriter



64
65
66
# File 'ext/meddata/src/meddparser.rb', line 64

def initialize
  @tablehandlers = []
end

Instance Method Details

- (Object) extract_data(template)



67
68
69
70
71
72
73
74
75
76
77
78
# File 'ext/meddata/src/meddparser.rb', line 67

def extract_data(template)
  data = {}
  @tablehandlers.each { |handler|
    unless(handler.nil?)
      id = handler.attributes.first[1]
      if(id.match(/tblFind/u) || id.match(/Table2/u))
        data = handler.extract_cdata(template)
      end
    end
  }
  data
end

- (Object) new_tablehandler(handler)



79
80
81
82
# File 'ext/meddata/src/meddparser.rb', line 79

def new_tablehandler(handler)
  @current_tablehandler = handler
  @tablehandlers.push(handler)
end

- (Object) send_flowing_data(data)



83
84
85
86
87
# File 'ext/meddata/src/meddparser.rb', line 83

def send_flowing_data(data) 
  unless(@current_tablehandler.nil?)
    @current_tablehandler.send_cdata(data)
  end
end