Class: Sports::Matchlist
- Inherits:
-
Object
- Object
- Sports::Matchlist
- Defined in:
- lib/sportdb/structs/structs/matchlist.rb
Overview
todo: find a better name - MatchStats, MatchFixtures, MatchSchedule, …
Defined Under Namespace
Classes: StatLine
Instance Attribute Summary collapse
-
#matches ⇒ Object
readonly
use MatchCache/Buffer/Summary/Snippet/Segment/List…
Instance Method Summary collapse
- #dates_str ⇒ Object
- #days ⇒ Object
- #end_date ⇒ Object
- #end_date? ⇒ Boolean
- #goals ⇒ Object
- #has_dates? ⇒ Boolean
-
#initialize(matches) ⇒ Matchlist
constructor
add last_updated/updated or something - why? why not?.
- #match_counts ⇒ Object
- #match_counts_str ⇒ Object
- #rounds ⇒ Object
-
#rounds? ⇒ Boolean
todo: add has_rounds? alias for rounds? too return true if all match_played in team_usage are the same e.g.
- #stage_usage ⇒ Object
-
#stages ⇒ Object
note: returns empty array for stages for now - why? why not?.
- #start_date ⇒ Object
-
#start_date? ⇒ Boolean
note: start_date and end_date might be nil / optional missing!!!!.
- #team_usage ⇒ Object
- #teams ⇒ Object
- #usage ⇒ Object
Constructor Details
#initialize(matches) ⇒ Matchlist
add last_updated/updated or something - why? why not?
16 17 18 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 16 def initialize( matches ) @matches = matches end |
Instance Attribute Details
#matches ⇒ Object (readonly)
use MatchCache/Buffer/Summary/Snippet/Segment/List…
or MatchAnalyzer/Checker/Proofer/Query - why? why not?
9 10 11 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 9 def matches @matches end |
Instance Method Details
#dates_str ⇒ Object
43 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 43 def dates_str() usage.dates_str; end |
#days ⇒ Object
44 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 44 def days() usage.days; end |
#end_date ⇒ Object
40 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 40 def end_date() usage.end_date; end |
#end_date? ⇒ Boolean
37 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 37 def end_date?() usage.end_date?; end |
#goals ⇒ Object
33 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 33 def goals() usage.goals; end |
#has_dates? ⇒ Boolean
42 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 42 def has_dates?() usage.has_dates?; end |
#match_counts ⇒ Object
54 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 54 def match_counts() usage.match_counts; end |
#match_counts_str ⇒ Object
55 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 55 def match_counts_str() usage.match_counts_str; end |
#rounds ⇒ Object
47 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 47 def rounds() usage.rounds; end |
#rounds? ⇒ Boolean
todo: add has_rounds? alias for rounds? too return true if all match_played in team_usage are the same
e.g. assumes league with matchday rounds
52 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 52 def rounds?() usage.rounds?; end |
#stage_usage ⇒ Object
59 60 61 62 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 59 def stage_usage @stage_usage ||= build_stage_usage( @matches ) @stage_usage end |
#stages ⇒ Object
note: returns empty array for stages for now - why? why not?
64 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 64 def stages() stage_usage.keys; end |
#start_date ⇒ Object
39 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 39 def start_date() usage.start_date; end |
#start_date? ⇒ Boolean
note: start_date and end_date might be nil / optional missing!!!!
36 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 36 def start_date?() usage.start_date?; end |
#team_usage ⇒ Object
26 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 26 def team_usage() usage.team_usage; end |
#teams ⇒ Object
28 29 30 31 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 28 def teams @team_names ||= team_usage.keys.sort @team_names end |
#usage ⇒ Object
21 22 23 24 |
# File 'lib/sportdb/structs/structs/matchlist.rb', line 21 def usage @usage ||= build_usage( @matches ) @usage end |