Sha256: 8f00bcd8b94b4a674bfd6cea91209abcc8dfa357ec30e91171d7c9bb5196b9b4
Contents?: true
Size: 1.26 KB
Versions: 1
Compression:
Stored size: 1.26 KB
Contents
module Sportradar module Api class Images::Asset < Data attr_accessor :response, :id, :created, :updated, :title, :description, :copyright, :links, :tags def initialize(data) @response = data @id = data["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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sportradar-api-0.1.21 | lib/sportradar/api/images/asset.rb |