Sha256: a99d820de392498fbdba6af68fe267440bc9f8ff0578405adbfe6cd983b4b67f

Contents?: true

Size: 1.11 KB

Versions: 9

Compression:

Stored size: 1.11 KB

Contents

module Sportradar
  module Api
    module Baseball
      class Event
        class Lineup < Data
          attr_accessor :response, :id, :hitter_id, :outcome, :description, :event, :player_id, :order, :position, :team_id, :last_name, :first_name, :preferred_name, :jersey_number

          def initialize(data, **opts)
            # @response       =  data
            @event          =  opts[:event]
            @id             =  data["id"]
            @player_id      =  data["player_id"]
            @order          =  data["order"]
            @position       =  data["position"]
            @team_id        =  data["team_id"]
            @last_name      =  data["last_name"]
            @first_name     =  data["first_name"]
            @preferred_name =  data["preferred_name"]
            @jersey_number  =  data["jersey_number"]

            update(data)
          end

          def update(data, **opts)
            lineup = event.half_inning.inning.game.lineup
            lineup.update_from_lineup_event(data)
          end

          def data_key
            'lineup'
          end

        end
      end
    end
  end
end



Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sportradar-api-0.10.45 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.44 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.43 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.42 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.41 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.40 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.39 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.38 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.10.37 lib/sportradar/api/baseball/events/lineup.rb