Class: FootballApi::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/football_api/event.rb

Constant Summary collapse

TYPES =
%w(yellowcard goal redcard yellowred)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Event

Returns a new instance of Event.



8
9
10
11
12
13
14
15
16
17
# File 'lib/football_api/event.rb', line 8

def initialize(hash = {})
  @event_id        = hash[:event_id]
  @event_match_id  = hash[:event_match_id]
  @event_type      = hash[:event_type]
  @event_minute    = hash[:event_minute]
  @event_team      = hash[:event_team]
  @event_player    = hash[:event_player]
  @event_player_id = hash[:event_player_id]
  @event_result    = hash[:event_result]
end

Instance Attribute Details

#event_idObject

Returns the value of attribute event_id.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_id
  @event_id
end

#event_match_idObject

Returns the value of attribute event_match_id.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_match_id
  @event_match_id
end

#event_minuteObject

Returns the value of attribute event_minute.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_minute
  @event_minute
end

#event_playerObject

Returns the value of attribute event_player.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_player
  @event_player
end

#event_player_idObject

Returns the value of attribute event_player_id.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_player_id
  @event_player_id
end

#event_resultObject

Returns the value of attribute event_result.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_result
  @event_result
end

#event_teamObject

Returns the value of attribute event_team.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_team
  @event_team
end

#event_typeObject

Returns the value of attribute event_type.



5
6
7
# File 'lib/football_api/event.rb', line 5

def event_type
  @event_type
end