Class: Stattleship::Feat

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

Instance Method Summary collapse

Instance Method Details

#dumpObject


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
54
55
56
# File 'lib/stattleship/feats.rb', line 15

def dump
  {
    accomplished_vs: accomplished_vs,
    accomplishment: accomplishment,
    actual: actual,
    category: category,
    description: description,
    game_id: game_id,
    game_slug: game_slug,
    humanized_stat_type: humanized_stat_type,
    level: level,
    level_numeric: level_numeric,
    name: name,
    on: on,
    opponent_abbrev: opponent_abbrev,
    opponent_location: opponent_location,
    opponent_name: opponent_name,
    opponent_nickname: opponent_nickname,
    opponent_slug: opponent_slug,
    player_id: player_id,
    player_slug: player_slug,
    sentence: sentence,
    sentence_on: sentence_on,
    sentence_vs: sentence_vs,
    sentence_vs_on: sentence_vs_on,
    subject: subject.dump,
    subject_id: subject_id,
    subject_name: subject_name,
    subject_slug: subject_slug,
    subject_team_abbrev: subject_team_abbrev,
    subject_team_location: subject_team_location,
    subject_team_name: subject_team_name,
    subject_team_nickname: subject_team_nickname,
    subject_team_slug: subject_team_slug,
    subject_type: subject_type,
    team_id: team_id,
    team_slug: team_slug,
    title: title,
    verb: verb,
    vs: vs,
  }
end

#subjectObject


7
8
9
# File 'lib/stattleship/feats.rb', line 7

def subject
  player || team
end

#subject_nameObject


3
4
5
# File 'lib/stattleship/feats.rb', line 3

def subject_name
  subject.name
end

#to_sentenceObject


11
12
13
# File 'lib/stattleship/feats.rb', line 11

def to_sentence
  sentence_vs_on
end