Class: Sportradar::Api::Images::Asset

Inherits:
Data
  • Object
show all
Defined in:
lib/sportradar/api/images/asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Data

#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data

Constructor Details

#initialize(data) ⇒ Asset

Returns a new instance of Asset.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/sportradar/api/images/asset.rb', line 6

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"]
  @links = parse_into_array(selector: response["links"]["link"], klass: Sportradar::Api::Images::Link)  if response["links"] && response["links"]["link"]
  @tags = parse_into_array(selector: response["tags"]["tag"], klass: Sportradar::Api::Images::Tag)  if response["tags"] && response["tags"]["tag"]
  @refs = parse_into_array(selector: response["refs"]["ref"], klass: Sportradar::Api::Images::Ref)  if response["refs"] && response["refs"]["ref"]
end

Instance Attribute Details

Returns the value of attribute copyright.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def copyright
  @copyright
end

#createdObject

Returns the value of attribute created.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def created
  @created
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def description
  @description
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def id
  @id
end

Returns the value of attribute links.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def links
  @links
end

#player_idObject

Returns the value of attribute player_id.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def player_id
  @player_id
end

#refsObject

Returns the value of attribute refs.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def refs
  @refs
end

#responseObject

Returns the value of attribute response.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def response
  @response
end

#tagsObject

Returns the value of attribute tags.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def tags
  @tags
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def title
  @title
end

#updatedObject

Returns the value of attribute updated.



4
5
6
# File 'lib/sportradar/api/images/asset.rb', line 4

def updated
  @updated
end