class Footy::Fixture
Attributes
date[RW]
id[RW]
localteam[RW]
status[RW]
time[RW]
visitorteam[RW]
Public Class Methods
from_array(fixtures)
click to toggle source
# File lib/footy/fixture.rb, line 19 def from_array fixtures fixtures.collect{ |f| Footy::Fixture.new f['match_id'], f['match_formatted_date'], f['match_time'], f['match_status'], f['match_localteam_id'], f['match_localteam_name'], f['match_visitorteam_id'], f['match_visitorteam_name'] } end
new(id, date, time, status, localteam_id, localteam_name, visitorteam_id, visitorteam_name)
click to toggle source
# File lib/footy/fixture.rb, line 4 def initialize id, date, time, status, localteam_id, localteam_name, visitorteam_id, visitorteam_name @id = id @date = date @time = time @status = status @localteam = Footy::Team.new localteam_id, localteam_name @visitorteam = Footy::Team.new visitorteam_id, visitorteam_name end
Public Instance Methods
commentary()
click to toggle source
# File lib/footy/fixture.rb, line 13 def commentary response = Footy::Api.call :Action => 'commentaries', :match_id => self.id Footy::Commentary.parse_from_response(response["commentaries"].first) if response["ERROR"] == "OK" end