Array
# File lib/admin/suggestion/types.rb, line 222 def +(add) # need to return a Container - default morphs to Array if add.is_a? Array add.each {|x| self << x} else # adding an element, don't make me think about += vs << self << add end self end
# File lib/admin/suggestion/types.rb, line 230 def compact # need to return a Container - default morphs to Array Container.new + super end
# File lib/admin/suggestion/types.rb, line 251 def for_district(uuid) Container.new + select {|sugg| sugg.district_uuid == uuid} end
# File lib/admin/suggestion/types.rb, line 245 def for_general for_scope("general") end
# File lib/admin/suggestion/types.rb, line 248 def for_profile(profile) Container.new + select {|sugg| sugg.profile == profile} end
# File lib/admin/suggestion/types.rb, line 235 def for_scope(scope, filter = nil) VALID_SCOPES.include?(scope) || raise("invalid scope: #{scope}") c = Container.new + select {|sugg| sugg.scope == scope} return c if filter.nil? case scope when "profile"; c.for_profile(filter) when "district"; c.for_district(filter) else; c end end
# File lib/admin/suggestion/types.rb, line 260 def group_by_class inject(Hash.new) {|h,sugg| (h[sugg.class] ||= Container.new) << sugg; h } end
# File lib/admin/suggestion/types.rb, line 257 def group_by_district_uuid inject(Hash.new) {|h,sugg| (h[sugg.district_uuid] ||= Container.new) << sugg; h } end
Generated with the Darkfish Rdoc Generator 2.