Sha256: 76ef6c9275a431d0dd19ff47e202ef62aa8070baeb621f3bb8e183a92e8348e8
Contents?: true
Size: 1.31 KB
Versions: 17
Compression:
Stored size: 1.31 KB
Contents
module Sportradar module Api class Images::Asset < Data attr_accessor :response, :id, :player_id, :created, :updated, :title, :description, :copyright, :links, :tags def initialize(data) @response = data @id = data["id"] @player_id = data["player_id"] @created = data["created"] @updated = data["updated"] @title = data["title"] @description = data["description"] @copyright = data["copyright"] set_links set_tags end private def set_links if response["links"] && response["links"]["link"] if response["links"]["link"].is_a?(Array) @links = response["links"]["link"].map {|x| Sportradar::Api::Images::Link.new x } elsif response["links"]["link"].is_a?(Hash) @links = [ Sportradar::Api::Images::Link.new(response["links"]["link"]) ] end end end def set_tags if response["tags"] && response["tags"]["tag"] if response["tags"]["tag"].is_a?(Array) @tags = response["tags"]["tag"].map {|x| Sportradar::Api::Images::Tag.new x } elsif response["tags"]["tag"].is_a?(Hash) @tags = [ Sportradar::Api::Images::Tag.new(response["tags"]["tag"]) ] end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems