class FootballApi::Stats

Attributes

corners[RW]
fouls[RW]
offsides[RW]
ongoal_shots[RW]
possestiontime[RW]
redcards[RW]
saves[RW]
total_shots[RW]
yellowcards[RW]

Public Class Methods

new(hash = {}) click to toggle source
# File lib/football_api/match_stats.rb, line 17
def initialize(hash = {})
  @total_shots    = hash[:shots][:total]          if hash[:shots]
  @ongoal_shots   = hash[:shots][:ongoal]         if hash[:shots]
  @fouls          = hash[:fouls][:total]          if hash[:fouls]
  @corners        = hash[:corners][:total]        if hash[:corners]
  @offsides       = hash[:offsides][:total]       if hash[:offsides]
  @possestiontime = hash[:possestiontime][:total] if hash[:possestiontime]
  @yellowcards    = hash[:yellowcards][:total]    if hash[:yellowcards]
  @redcards       = hash[:redcards][:total]       if hash[:redcards]
  @saves          = hash[:saves][:total]          if hash[:saves]
end