Class: Sportradar::Api::Football::StatPack::Penalties
- Inherits:
-
Sportradar::Api::Football::StatPack
- Object
- Data
- Sportradar::Api::Football::StatPack
- Sportradar::Api::Football::StatPack::Penalties
- Defined in:
- lib/sportradar/api/football/stat_pack/penalties.rb
Instance Attribute Summary collapse
-
#penalties ⇒ Object
(also: #count)
Returns the value of attribute penalties.
-
#yards ⇒ Object
Returns the value of attribute yards.
Attributes inherited from Sportradar::Api::Football::StatPack
#id, #name, #player, #players, #position, #response
Instance Method Summary collapse
Methods inherited from Sportradar::Api::Football::StatPack
Methods inherited from Data
#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data
Constructor Details
This class inherits a constructor from Sportradar::Api::Football::StatPack
Instance Attribute Details
#penalties ⇒ Object Also known as: count
Returns the value of attribute penalties.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/penalties.rb', line 4 def penalties @penalties end |
#yards ⇒ Object
Returns the value of attribute yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/penalties.rb', line 4 def yards @yards end |
Instance Method Details
#formatted ⇒ Object
14 15 16 |
# File 'lib/sportradar/api/football/stat_pack/penalties.rb', line 14 def formatted "#{count}-#{yards}" end |
#set_stats ⇒ Object
8 9 10 11 12 |
# File 'lib/sportradar/api/football/stat_pack/penalties.rb', line 8 def set_stats @response = (response.dig(1) || {}) if response.is_a? Array @penalties = response.dig('penalties') || response['num'] @yards = response.dig('yards') || response['yds'] end |