Class: Sportradar::Api::Content::ArticleList
- Defined in:
- lib/sportradar/api/content/article_list.rb
Instance Attribute Summary collapse
-
#articles ⇒ Object
Returns the value of attribute articles.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#response ⇒ Object
Returns the value of attribute response.
-
#sport ⇒ Object
Returns the value of attribute sport.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
-
#initialize(data) ⇒ ArticleList
constructor
A new instance of ArticleList.
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
#articles ⇒ Object
Returns the value of attribute articles.
4 5 6 |
# File 'lib/sportradar/api/content/article_list.rb', line 4 def articles @articles end |
#end_time ⇒ Object
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 |
#provider ⇒ Object
Returns the value of attribute provider.
4 5 6 |
# File 'lib/sportradar/api/content/article_list.rb', line 4 def provider @provider end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/sportradar/api/content/article_list.rb', line 4 def response @response end |
#sport ⇒ Object
Returns the value of attribute sport.
4 5 6 |
# File 'lib/sportradar/api/content/article_list.rb', line 4 def sport @sport end |
#start_time ⇒ Object
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 |