forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathempty.rb
More file actions
53 lines (43 loc) · 945 Bytes
/
Copy pathempty.rb
File metadata and controls
53 lines (43 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
50
51
52
53
module AddressBook
# trivially empty implementation of AddressBook interface. useful for
# demonstrating the bare minimum of the type contract -- returns the right
# shapes but no data -- while being separate from the original
# MessageableUser strategy.
class Empty < AddressBook::Base
def known_users(users, options={})
[]
end
def common_courses(user)
{}
end
def common_groups(user)
{}
end
def known_in_context(context, is_admin=false)
[]
end
def count_in_context(context)
0
end
module Bookmarker
def self.bookmark_for(user)
'unused'
end
def self.validate(bookmark)
true
end
end
def search_users(options={})
BookmarkedCollection.build(Bookmarker) { |pager| pager }
end
def preload_users(users)
[]
end
def sections
[]
end
def groups
[]
end
end
end