class FootballApi::Bench

Attributes

players[RW]
team[RW]

Public Class Methods

new(opts = {}, key) click to toggle source
# File lib/football_api/match_bench.rb, line 17
def initialize(opts = {}, key)
  # XXX - Use case for more than one player, might be different
  # Api returns single object without number index on single occurrence.
  opts = opts[key]
  return unless opts.present?

  @team = key
  @players = Array(opts[:player]).map { |v| Player.new(v) }
end