main
1module.exports = Enumerable =
2 any: (predicate) ->
3 result = false
4 @each (item) =>
5 result = predicate(item)
6 return if result
7 result
8
9 includes: (other_item) ->
10 result = false
11 @each (item) =>
12 result ||= (item == other_item || item.equals(other_item))
13 result
14
15 find_all: (predicate) ->
16 results = []
17 @each (item) =>
18 results.push(item) if predicate(item)
19 results
20
21 all: (specification) ->
22 @find_all (movie) ->
23 specification.matches(movie)
24
25