Sha256: 0dcae3666fd07c52b452b273833b211207d81228b1d1607fd74cef404113c54d

Contents?: true

Size: 1.23 KB

Versions: 183

Compression:

Stored size: 1.23 KB

Contents

module Sportradar
  module Api
    module Basketball
      class Injury < Data
        attr_accessor :response, :id, :comment, :descripton, :status, :start_date, :update_date

        def initialize(data, **opts)
          @response = data
          update(data, **opts)
        end

        def update(data, **opts)
          @id           = data.last&.dig('id')
          @comment      = data.last&.dig('comment')
          @descripton   = data.last&.dig('desc')
          @status       = data.last&.dig('status')
          @start_date   = data.last&.dig('start_date')
          @update_date  = data.last&.dig('update_date')
        end

        def out?
          @status == 'Out'
        end

        private def sample_data
          {
            "injury" => {
              "id"         => "069a9d3f-036e-4dab-9b49-d2e75082230e",
              "comment"    => "Paul will have surgery to repair torn ligaments in his left thumb and is expected to be out for six-to-eight weeks to recover, according to a report from ESPN.com.",
              "desc"       => "Thumb",
              "status"     => "Out",
              "start_date" => "2017-01-17",
              "update_date"=> "2017-01-17"
            }
          }
        end

      end
    end
  end
end

Version data entries

183 entries across 183 versions & 1 rubygems

Version Path
sportradar-api-0.10.43 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.42 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.41 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.40 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.39 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.38 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.37 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.36 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.35 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.34 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.33 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.32 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.31 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.30 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.29 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.28 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.27 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.26 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.25 lib/sportradar/api/basketball/injury.rb
sportradar-api-0.10.24 lib/sportradar/api/basketball/injury.rb