Sha256: 89a4ba9c75ac3979a4059e3390fb0ab5ec1e1565d327f93c4345d2f8b14b3f27

Contents?: true

Size: 863 Bytes

Versions: 32

Compression:

Stored size: 863 Bytes

Contents

module Sportradar
  module Api
    class Soccer::Category < Data
      attr_accessor :response, :id, :name, :country_code, :country, :tournament_groups

      def initialize(data)
        @response = data
        @id = data["id"]
        @name = data["name"]
        @country_code = data["country_code"]
        @country = data["country"]
        set_tournament_group
      end

      private
      def set_tournament_group
        if response["tournament_group"]
          if response["tournament_group"].is_a?(Array)
            @tournament_groups = response["tournament_group"].map {|x| Sportradar::Api::Soccer::TournamentGroup.new x }
          elsif response["tournament_group"].is_a?(Hash)
            @tournament_groups = [ Sportradar::Api::Soccer::TournamentGroup.new(response["tournament_group"]) ]
          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/category.rb
sportradar-api-0.1.37 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.36 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.35 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.34 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.33 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.32 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.31 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.30 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.29 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.28 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.27 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.26 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.25 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.24 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.23 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.22 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.21 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.19 lib/sportradar/api/soccer/category.rb
sportradar-api-0.1.18 lib/sportradar/api/soccer/category.rb