Class: ODDB::State::Drugs::Init

Inherits:
Global show all
Defined in:
src/state/drugs/init.rb,
test/test_state/drugs/init.rb,
test/test_state/admin/root.rb,
src/state/global_predefine.rb

Constant Summary

VIEW =
View::Drugs::Search
DIRECT_EVENT =
:home_drugs
RESOLVE_STATES =
{
  [:resolve] => State::Admin::StubResolvedState
}
REVERSE_MAP =
{
  :to_f =>  true,
}

Constants inherited from Global

HOME_STATE, ZONE, ZONE_NAVIGATION

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 Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Global

#limit_state

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, #limit_state, #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 Admin::LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Attribute Details

- (Object) sort_reverse

Returns the value of attribute sort_reverse



17
18
19
# File 'test/test_state/drugs/init.rb', line 17

def sort_reverse
  @sort_reverse
end

- (Object) sortby

Returns the value of attribute sortby



17
18
19
# File 'test/test_state/drugs/init.rb', line 17

def sortby
  @sortby
end

Instance Method Details

- (Object) compare_entries

- (Object) get_sortby!

- (Object) init



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'src/state/drugs/init.rb', line 14

def init
  super
  @model = OpenStruct.new
  fachinfos = @session.app.sorted_fachinfos
  if newest = fachinfos.first
    revision = newest.revision
    date = Time.local(revision.year, revision.month, revision.day)
    day = 24 * 3600
    range = (date-day)...(date+day)
    @model.fachinfo_news = fachinfos.select { |fi|
      range.include? fi.revision
    }
  end
  @model.feedbacks = @session.app.sorted_feedbacks[0,5]
end