Sha256: 9d0ff85a52be0d4d3f033ca7e0c839f4ac09faeb9cd3483aed2a8d798ff6b35a

Contents?: true

Size: 640 Bytes

Versions: 18

Compression:

Stored size: 640 Bytes

Contents

module Sportradar
  module Api
    class Images::AssetList < Data
      attr_accessor :response, :type, :sport, :assets

      def initialize(data)
        @response = data
        @type = data["type"]
        @sport = data["sport"]
        set_assets
      end

      private
      def set_assets
        if response["asset"]
          if response["asset"].is_a?(Array)
            @assets = response["asset"].map {|x| Sportradar::Api::Images::Asset.new x }
          elsif response["asset"].is_a?(Hash)
            @assets = [ Sportradar::Api::Images::Asset.new(response["asset"]) ]
          end
        end
      end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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