Class: ODDB::View::Drugs::MiniFiChapter

Inherits:
Chapter
  • Object
show all
Includes:
AdditionalInformation, Latin1
Defined in:
src/view/drugs/minifi.rb

Direct Known Subclasses

Rss::MiniFiItem

Constant Summary

Constants included from ChapterMethods

PAR_STYLE, PRE_STYLE, SUB_STYLE, TABLE_STYLE, TD_STYLE

Instance Method Summary (collapse)

Methods included from Latin1

#sanitize

Methods included from AdditionalInformation

#_fachinfo, #atc_ddd_link, #atc_description, #comarketing, #complementary_type, #compositions, #ddd_price, #deductible, #fachinfo, #feedback, #google_search, #ikscat, #limitation_link, #limitation_text, #minifi, #narcotic, #notify, #patent, #patinfo, #qty_unit, #square, #twitter_share

Methods included from PartSize

#comparable_size, #part_size

Methods included from AtcDddLink

#atc_ddd_link

Methods included from ChapterMethods

#formats, #heading, #paragraphs, #sections, #table

Constructor Details

- (MiniFiChapter) initialize(model, session, container)

A new instance of MiniFiChapter



15
16
17
18
# File 'src/view/drugs/minifi.rb', line 15

def initialize(model, session, container)
  super(session.language, model, session, container)
  @registration = @model.registrations.first
end

Instance Method Details



34
35
36
37
38
39
40
41
42
43
44
# File 'src/view/drugs/minifi.rb', line 34

def footer(context)
  if(@registration)
    [
      atc_ddd_link(@registration.atc_classes.first),
      comarketing(@registration),
      google_search(@registration),
    ].compact.collect { |part| 
      part.to_html(context) 
    }.join(@lookandfeel.lookup(:navigation_divider))
  end
end


19
20
21
22
23
24
25
26
27
28
29
# File 'src/view/drugs/minifi.rb', line 19

def link_product(context, html)
  ptrn = /#{@model.name}(®|\(TM\))?/u
  link = HtmlGrid::Link.new(:name, @model, @session, self)
  link.href = @lookandfeel._event_url(:search, 
                                      :search_type => 'st_sequence', 
                                      :search_query => @model.name.gsub('/', '%2F'))
  html.gsub(ptrn) { |match|
    link.value = match
    link.to_html(context)
  }
end

- (Object) to_html(context)



30
31
32
33
# File 'src/view/drugs/minifi.rb', line 30

def to_html(context)
  link_product(context, sanitize(sections(context, @value.sections))) \
    << footer(context).to_s
end