Sha256: fc358a4e7aca4f92e6524a15355228809b7065cc3c4f1f22b57071f579557fec

Contents?: true

Size: 701 Bytes

Versions: 32

Compression:

Stored size: 701 Bytes

Contents

module Sportradar
  module Api
    class Soccer::Standing < Data
      attr_accessor :response, :categories

      def initialize(data)
        @response = data
        set_categories
      end

      private

      def set_categories
        if response["categories"] && response["categories"]["category"]
          if response["categories"]["category"].is_a?(Array)
            @categories = response["categories"]["category"].map {|x| Sportradar::Api::Soccer::Category.new x }
          elsif response["categories"]["category"].is_a?(Hash)
            @categories = [ Sportradar::Api::Soccer::Category.new(response["categories"]["category"]) ]
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

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