Class: Infostrada::MatchEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/infostrada/match_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ MatchEvent

Returns a new instance of MatchEvent.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/infostrada/match_event.rb', line 8

def initialize(hash)
  @id                 = hash['n_ActionID']
  @description        = hash['c_Action']
  @short_description  = hash['c_ActionShort']
  @period             = hash['c_Period']
  @period_short       = hash['c_PeriodShort']
  @time               = hash['n_ActionTime']
  @home_goals         = hash['n_HomeGoals']
  @away_goals         = hash['n_AwayGoals']
  @home_event         = (hash['n_HomeOrAway'] == 1) ? true : false
  @team_id            = hash['n_TeamID']
  @team_name          = hash['c_Team']
  @team_short_name    = hash['c_TeamShort']
  @person_id          = hash['n_PersonID']
  @person_name        = hash['c_Person']
  @person_short_name  = hash['c_PersonShort']
  @reason             = hash['c_ActionReason']
  @info               = hash['c_ActionInfo']
  @person2_id         = hash['n_SubPersonID']
  @person2_name       = hash['c_SubPerson']
  @person2_short_name = hash['c_SubPersonShort']
  @minute             = hash['c_ActionMinute']

  self
end

Instance Attribute Details

#away_goalsObject

Returns the value of attribute away_goals.



4
5
6
# File 'lib/infostrada/match_event.rb', line 4

def away_goals
  @away_goals
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def description
  @description
end

#home_eventObject

Returns the value of attribute home_event.



4
5
6
# File 'lib/infostrada/match_event.rb', line 4

def home_event
  @home_event
end

#home_goalsObject

Returns the value of attribute home_goals.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def home_goals
  @home_goals
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def id
  @id
end

#infoObject

Returns the value of attribute info.



5
6
7
# File 'lib/infostrada/match_event.rb', line 5

def info
  @info
end

#minuteObject

Returns the value of attribute minute.



6
7
8
# File 'lib/infostrada/match_event.rb', line 6

def minute
  @minute
end

#periodObject

Returns the value of attribute period.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def period
  @period
end

#period_shortObject

Returns the value of attribute period_short.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def period_short
  @period_short
end

#person2_idObject

Returns the value of attribute person2_id.



5
6
7
# File 'lib/infostrada/match_event.rb', line 5

def person2_id
  @person2_id
end

#person2_nameObject

Returns the value of attribute person2_name.



5
6
7
# File 'lib/infostrada/match_event.rb', line 5

def person2_name
  @person2_name
end

#person2_short_nameObject

Returns the value of attribute person2_short_name.



6
7
8
# File 'lib/infostrada/match_event.rb', line 6

def person2_short_name
  @person2_short_name
end

#person_idObject

Returns the value of attribute person_id.



4
5
6
# File 'lib/infostrada/match_event.rb', line 4

def person_id
  @person_id
end

#person_nameObject

Returns the value of attribute person_name.



5
6
7
# File 'lib/infostrada/match_event.rb', line 5

def person_name
  @person_name
end

#person_short_nameObject

Returns the value of attribute person_short_name.



5
6
7
# File 'lib/infostrada/match_event.rb', line 5

def person_short_name
  @person_short_name
end

#reasonObject

Returns the value of attribute reason.



5
6
7
# File 'lib/infostrada/match_event.rb', line 5

def reason
  @reason
end

#short_descriptionObject

Returns the value of attribute short_description.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def short_description
  @short_description
end

#team_idObject

Returns the value of attribute team_id.



4
5
6
# File 'lib/infostrada/match_event.rb', line 4

def team_id
  @team_id
end

#team_nameObject

Returns the value of attribute team_name.



4
5
6
# File 'lib/infostrada/match_event.rb', line 4

def team_name
  @team_name
end

#team_short_nameObject

Returns the value of attribute team_short_name.



4
5
6
# File 'lib/infostrada/match_event.rb', line 4

def team_short_name
  @team_short_name
end

#timeObject

Returns the value of attribute time.



3
4
5
# File 'lib/infostrada/match_event.rb', line 3

def time
  @time
end