Sha256: 080613c9fb1fae33921a9ab8f7a8367a7bd8efda12802eced5b093fac76ce512

Contents?: true

Size: 608 Bytes

Versions: 32

Compression:

Stored size: 608 Bytes

Contents

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

      def initialize(data)
        @response = data
        set_categories
      end

      private

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