lib/sportradar/api/content.rb in sportradar-api-0.1.38 vs lib/sportradar/api/content.rb in sportradar-api-0.9.0
- old
+ new
@@ -8,19 +8,27 @@
@sport = sport
raise Sportradar::Api::Error::InvalidAccessLevel unless allowed_access_levels.include? access_level
@access_level = access_level
end
- def news( date = Date.today, content_type = 'all' )
+ def news( date = Date.today, content_type: 'all' )
raise Sportradar::Api::Error::InvalidType unless allowed_news_types.include? content_type
response = get request_url("#{provider }/news/#{date_path(date)}/#{content_type}")
- Sportradar::Api::Content::ArticleList.new response["content"] if response.success? && response["content"]
+ if response.success? && response["content"]
+ Sportradar::Api::Content::ArticleList.new response["content"]
+ else
+ response
+ end
end
- def analysis( date = Date.today, content_type = 'all' )
+ def analysis( date = Date.today, content_type: 'all' )
raise Sportradar::Api::Error::InvalidType unless allowed_analysis_types.include? content_type
response = get request_url("#{provider }/analysis/#{date_path(date)}/#{content_type}")
- Sportradar::Api::Content::ArticleList.new response["content"] if response.success? && response["content"]
+ if response.success? && response["content"]
+ Sportradar::Api::Content::ArticleList.new response["content"]
+ else
+ response
+ end
end
private
def request_url(path)