Class: ODDB::State::Analysis::Global

Inherits:
Global show all
Defined in:
src/state/analysis/global.rb,
src/state/global_predefine.rb

Direct Known Subclasses

Alphabetical, Init, Position, Result

Constant Summary

HOME_STATE =
State::Analysis::Init
ZONE =
:analysis
ZONE_NAVIGATION =
[:analysis_alphabetical]

Constants inherited from Global

DIRECT_EVENT, GLOBAL_MAP, HOME_STATE, LIMITED, PRINT_STATES, READONLY_STATES, RESOLVE_STATES, REVERSE_MAP, VIEW, ZONE_NAVIGATION

Constants included from UmlautSort

FILTER_PAIRS

Instance Method Summary (collapse)

Methods inherited from Global

#_search_drugs, #_search_drugs_state, #_trigger, #add_to_interaction_basket, #allowed?, #atc_chooser, #checkout, #clear_interaction_basket, #creditable?, #direct_request_path, #doctorlist, #download, #export_csv, #extend, #fachinfo, #feedbacks, #help_navigation, #home_navigation, #home_state, #hospitallist, #interaction_basket, #limited?, #logout, #navigation, #notify, #password_reset, #paypal_return, #powerlink, #print, #proceed_download, #proceed_poweruser, #resolve, #resolve_state, #rss, #search, #show, #snapback_event, #sort, #sponsorlink, #suggest_address, #switch, #unique_email, #user_input, #user_navigation, #ywesee_contact, #zone_navigation, #zones

Methods included from ODDB::State::Admin::LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Method Details

- (Object) compare_entries(a, b)



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'src/state/analysis/global.rb', line 17

def compare_entries(a, b)
  @sortby.each { |sortby|
    case sortby
    when :description
      sortby = [@session.language]
    when :list_title
      sortby = [sortby, @session.language]
    else
      sortby = [sortby]
    end
    aval, bval = nil
    begin
      aval = umlaut_filter(sortby.inject(a) { |memo, meth|
        memo.send(meth) })
      bval = umlaut_filter(sortby.inject(b) { |memo, meth|
        memo.send(meth) })
    rescue Exception => e
      puts e
      next
    end
    res = if (aval.nil? && bval.nil?)
      0
    elsif (aval.nil?)
      1
    elsif (bval.nil?)
      -1
    else 
      aval <=> bval
    end
    return res unless(res == 0)
  }
  0
end

- (Object) limit_state



14
15
16
# File 'src/state/analysis/global.rb', line 14

def limit_state
  State::Analysis::Limit.new(@session, nil)
end