Class: ODDB::State::Interactions::Result

Inherits:
Global show all
Defined in:
src/state/interactions/result.rb,
test/test_state/interactions/result.rb

Defined Under Namespace

Classes: Facade

Constant Summary

DIRECT_EVENT =

class Facade < SimpleDelegator

    attr_reader :obj_class, :objects
    def initialize(obj_class)
      @obj_class = obj_class
      super(@obj_class)
      @objects = [] 
    end
    def add_object(obj)
      @objects.push(obj)
    end
    def empty?
      @objects.empty?
    end
    def objects 
      @objects.sort { |x, y| x.name <=> y.name }
    end
  end
:result
VIEW =
View::Interactions::Result
REVERSE_MAP =
View::Interactions::ResultList::REVERSE_MAP
ITEM_LIMIT =
150
LIMITED =
false

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) default_view (readonly)

Returns the value of attribute default_view



16
17
18
# File 'test/test_state/interactions/result.rb', line 16

def default_view
  @default_view
end

- (Object) facades

Returns the value of attribute facades



15
16
17
# File 'test/test_state/interactions/result.rb', line 15

def facades
  @facades
end

- (Object) object_count (readonly)

Returns the value of attribute object_count



35
36
37
# File 'src/state/interactions/result.rb', line 35

def object_count
  @object_count
end

- (Object) pages (readonly)

Returns the value of attribute pages



35
36
37
# File 'src/state/interactions/result.rb', line 35

def pages
  @pages
end

Instance Method Details

- (Object) init



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'src/state/interactions/result.rb', line 36

def init
  #@facades = {}
  @object_count = 0
  if(@model.nil? || @model.empty?)
    @default_view = View::Interactions::EmptyResult
  else
    @model.each { |obj|
      @object_count += 1
    }
    @model.uniq!
    @model.sort! { |x, y| 
      x.name <=> y.name
    }
  end
end