Class: ODDB::Interaction::TableLinksWriter

Inherits:
NullWriter show all
Defined in:
src/plugin/flockhart.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NullWriter

#new_fonthandler, #new_tablehandler, #send_image, #send_meta

Constructor Details

- (TableLinksWriter) initialize

A new instance of TableLinksWriter



241
242
243
# File 'src/plugin/flockhart.rb', line 241

def initialize
  @links = []
end

Instance Attribute Details

Returns the value of attribute links



240
241
242
# File 'src/plugin/flockhart.rb', line 240

def links
  @links
end

Instance Method Details

- (Object) extract_data



244
245
# File 'src/plugin/flockhart.rb', line 244

def extract_data
end

- (Object) new_linkhandler(handler)



246
247
248
249
250
251
252
253
254
255
256
# File 'src/plugin/flockhart.rb', line 246

def new_linkhandler(handler)
  if handler && (link = handler.attribute('href'))
    valid_link = link.to_s.split(/#/u)[0]
    if(valid_link && valid_link.match(/.asp$/u) \
       && !(@links.include?(valid_link) \
            || /www.fda.gov/u.match(valid_link) \
            || FlockhartPlugin::INVALID_LINKS.include?(valid_link)))
      @links.push(valid_link)
    end
  end
end

- (Object) start_tr(attrs)



257
258
# File 'src/plugin/flockhart.rb', line 257

def start_tr(attrs)
end