Sha256: 5ad4083750029f4e46233e033ca5863231db47416726ae6c96cd40d2db098f19

Contents?: true

Size: 664 Bytes

Versions: 32

Compression:

Stored size: 664 Bytes

Contents

module Sportradar
  module Api
    class Soccer::Season < Data
      attr_accessor :response, :year, :statistics

      def initialize(data)
        @response = data
        @year = data["year"]
        set_statistics

      end

      private

      def set_statistics
        if response["statistic"]
          if response["statistic"].is_a?(Array)
            @statistics = response["statistic"].map {|statistic| Sportradar::Api::Soccer::Statistic.new statistic }
          elsif response["statistic"].is_a?(Hash)
            @statistics = [ Sportradar::Api::Soccer::Statistic.new(response["statistic"]) ]
          end
        end
      end

    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
sportradar-api-0.1.38 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.37 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.36 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.35 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.34 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.33 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.32 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.31 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.30 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.29 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.28 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.27 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.26 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.25 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.24 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.23 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.22 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.21 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.19 lib/sportradar/api/soccer/season.rb
sportradar-api-0.1.18 lib/sportradar/api/soccer/season.rb