Sha256: f9db150324f4e32d134d3d8f93175a069e7a268f7c5911984796d9587c14bbf9

Contents?: true

Size: 1.16 KB

Versions: 77

Compression:

Stored size: 1.16 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]
            @description    =  data["description"]
            @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

77 entries across 77 versions & 1 rubygems

Version Path
sportradar-api-0.11.28 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.27 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.26 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.25 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.24 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.23 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.22 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.21 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.20 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.19 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.18 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.17 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.16 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.15 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.14 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.13 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.12 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.11 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.10 lib/sportradar/api/baseball/events/lineup.rb
sportradar-api-0.11.9 lib/sportradar/api/baseball/events/lineup.rb