Class: Sportradar::Api::Content::ArticleList

Inherits:
Data
  • Object
show all
Defined in:
lib/sportradar/api/content/article_list.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) ⇒ ArticleList

Returns a new instance of ArticleList.



6
7
8
9
10
11
12
13
# File 'lib/sportradar/api/content/article_list.rb', line 6

def initialize(data)
  @response = data
  @sport = data["sport"]
  @provider = data["provider"]
  @start_time = Time.parse(data["start_time"]) if data["start_time"]
  @end_time = Time.parse(data["end_time"]) if data["end_time"]
  @articles = parse_into_array(selector: response["items"], klass: Sportradar::Api::Content::Article) if response["items"]
end

Instance Attribute Details

#articlesObject

Returns the value of attribute articles.



4
5
6
# File 'lib/sportradar/api/content/article_list.rb', line 4

def articles
  @articles
end

#end_timeObject

Returns the value of attribute end_time.



4
5
6
# File 'lib/sportradar/api/content/article_list.rb', line 4

def end_time
  @end_time
end

#providerObject

Returns the value of attribute provider.



4
5
6
# File 'lib/sportradar/api/content/article_list.rb', line 4

def provider
  @provider
end

#responseObject

Returns the value of attribute response.



4
5
6
# File 'lib/sportradar/api/content/article_list.rb', line 4

def response
  @response
end

#sportObject

Returns the value of attribute sport.



4
5
6
# File 'lib/sportradar/api/content/article_list.rb', line 4

def sport
  @sport
end

#start_timeObject

Returns the value of attribute start_time.



4
5
6
# File 'lib/sportradar/api/content/article_list.rb', line 4

def start_time
  @start_time
end