Class: Stattleship::Models::Ranking

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/stattleship/models/ranking.rb

Instance Method Summary collapse

Instance Method Details

#dumpObject


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/stattleship/models/ranking.rb', line 28

def dump
  {
    data: data,
    description: description,
    interval_type: interval_type,
    interval_value: interval_value,
    name: name,
    ordinal_place: ordinal_place,
    place: place,
    player_name: player_name,
    season_name: season_name,
    short_date: short_date,
    stat: stat,
    stat_value: stat_value,
    statline: statline,
    superlative: superlative,
    team_name: team_name,
    title: title
  }
end

#player_nameObject


4
5
6
# File 'lib/stattleship/models/ranking.rb', line 4

def player_name
  player.name if player
end

#seasonObject


8
9
10
# File 'lib/stattleship/models/ranking.rb', line 8

def season
  game.season if game
end

#season_nameObject


12
13
14
# File 'lib/stattleship/models/ranking.rb', line 12

def season_name
  season.name if season
end

#short_dateObject


20
21
22
# File 'lib/stattleship/models/ranking.rb', line 20

def short_date
  game.short_date if game
end

#team_nameObject


16
17
18
# File 'lib/stattleship/models/ranking.rb', line 16

def team_name
  team.name if team
end

#to_sentenceObject


24
25
26
# File 'lib/stattleship/models/ranking.rb', line 24

def to_sentence
  description
end