Skip to content

Commit a6fbc75

Browse files
committed
added Match#teams
1 parent b2ddc06 commit a6fbc75

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/esdb/match.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
module ESDB
22
class Match < ESDB::Resource
3+
# Combines all entities into a hash keys with the team number
4+
def teams
5+
entities.inject({}){|teams, entity|
6+
teams[entity['team']] ||= []
7+
teams[entity['team']] << entity
8+
teams
9+
}
10+
end
11+
312
def duration_minutes
413
return (duration_seconds / 60.0).round
514
end

0 commit comments

Comments
 (0)