Class: SBSM::LookandfeelWrapper

Inherits:
Lookandfeel
  • Object
show all
Defined in:
src/custom/lookandfeelwrapper.rb

Direct Known Subclasses

ODDB::LookandfeelAnthroposophy, ODDB::LookandfeelAtupri, ODDB::LookandfeelAtupriWeb, ODDB::LookandfeelButtons, ODDB::LookandfeelCarenaSchweiz, ODDB::LookandfeelComplementaryType, ODDB::LookandfeelDesitin, ODDB::LookandfeelExtern, ODDB::LookandfeelGenerika, ODDB::LookandfeelHomeopathy, ODDB::LookandfeelJustMedical, ODDB::LookandfeelKonsumInfo, ODDB::LookandfeelLanguages, ODDB::LookandfeelMobile, ODDB::LookandfeelMyMedi, ODDB::LookandfeelOekk, ODDB::LookandfeelPhytoPharma, ODDB::LookandfeelProvita, ODDB::LookandfeelSantesuisse, ODDB::LookandfeelStandardResult, ODDB::LookandfeelSwissMedInfo, ODDB::LookandfeelSwissmedic

Constant Summary

RESULT_FILTER =
nil

Instance Method Summary (collapse)

Instance Method Details

- (Object) format_price(price, currency = nil)



12
13
14
15
16
17
18
19
# File 'src/custom/lookandfeelwrapper.rb', line 12

def format_price(price, currency=nil)
  unless(price.is_a?(ODDB::Util::Money))
    price = price.to_f / 100.0
  end
  if(price.to_i > 0)
    [currency, sprintf('%.2f', price)].compact.join(' ')
  end
end

- (Boolean) has_result_filter?

Returns:

  • (Boolean)


20
21
22
# File 'src/custom/lookandfeelwrapper.rb', line 20

def has_result_filter?
  !!self.class::RESULT_FILTER
end

- (Object) result_filter(pac_or_seq)



23
24
25
26
27
28
29
# File 'src/custom/lookandfeelwrapper.rb', line 23

def result_filter pac_or_seq
  res = @component.result_filter pac_or_seq
  if res && flt = self.class::RESULT_FILTER
    res &&= flt.call(pac_or_seq)
  end
  res
end