Sha256: 00ec0c1b5fa5e8c9010e88ea74d0d6c55649fa7169f9588d73ee19e29b080c15

Contents?: true

Size: 684 Bytes

Versions: 13

Compression:

Stored size: 684 Bytes

Contents

module Sportradar
  module Api
    class Soccer::Boxscore < Data
      attr_accessor :response, :matches

      def initialize(data)
        @response = data
        set_matches
      end

      private
      def set_matches
        if response["boxscore"]["matches"]["match"]
          if response["boxscore"]["matches"]["match"].is_a?(Array)
            @matches = response["boxscore"]["matches"]["match"].map {|x| Sportradar::Api::Soccer::Match.new x }
          elsif response["boxscore"]["matches"]["match"].is_a?(Hash)
            @matches = [ Sportradar::Api::Soccer::Match.new(response["boxscore"]["matches"]["match"]) ]
          end
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sportradar-api-0.1.18 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.17 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.16 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.15 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.14 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.13 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.12 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.11 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.10 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.8 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.7 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.6 lib/sportradar/api/soccer/boxscore.rb
sportradar-api-0.1.5 lib/sportradar/api/soccer/boxscore.rb