Module: Ansa
- Defined in:
- lib/ansa.rb,
lib/ansa/news.rb,
lib/ansa/client.rb,
lib/ansa/errors.rb,
lib/ansa/constants.rb,
lib/ansa/docs/dynamic_docs.rb
Defined Under Namespace
Constant Summary collapse
- HOMEPAGE =
Constant for homepage news.
'homepage'
- NEWS =
Constant for main news.
'news'
- POLITICS =
Constant for politics news.
'politics'
- WORLD =
Constant for world news.
'world'
- ECONOMY =
Constant for economy news.
'economy'
- SOCCER =
Constant for soccer news.
'soccer'
- SPORT =
Constant for sport news.
'sport'
Class Method Summary collapse
-
.get_economy_news ⇒ Array<Ansa::News>
Get news for “economy” category.
-
.get_homepage_news ⇒ Array<Ansa::News>
Get news for “homepage” category.
-
.get_news(category) ⇒ Array<Ansa::News>
Get news given a category.
-
.get_news_news ⇒ Array<Ansa::News>
Get news for “news” category.
-
.get_politics_news ⇒ Array<Ansa::News>
Get news for “politics” category.
-
.get_soccer_news ⇒ Array<Ansa::News>
Get news for “soccer” category.
-
.get_sport_news ⇒ Array<Ansa::News>
Get news for “sport” category.
-
.get_world_news ⇒ Array<Ansa::News>
Get news for “world” category.
Class Method Details
.get_economy_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/notizie/economia/economia_rss.xml
Get news for “economy” category.
6 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 6 generate_get_news 'economy', 'http://www.ansa.it/sito/notizie/economia/economia_rss.xml', '1.0.0' |
.get_homepage_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/ansait_rss.xml
Get news for “homepage” category.
2 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 2 generate_get_news 'homepage', 'http://www.ansa.it/sito/ansait_rss.xml', '1.0.0' |
.get_news(category) ⇒ Array<Ansa::News>
Get news given a category.
48 49 50 51 52 53 |
# File 'lib/ansa/client.rb', line 48 def self.get_news(category) if not LINKS.include? category raise AnsaError.new("Category #{category} not available") end get_news_by_url(LINKS[category]) end |
.get_news_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/notizie/cronaca/cronaca_rss.xml
Get news for “news” category.
3 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 3 generate_get_news 'news', 'http://www.ansa.it/sito/notizie/cronaca/cronaca_rss.xml', '1.0.0' |
.get_politics_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/notizie/politica/politica_rss.xml
Get news for “politics” category.
4 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 4 generate_get_news 'politics', 'http://www.ansa.it/sito/notizie/politica/politica_rss.xml', '1.0.0' |
.get_soccer_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/notizie/sport/calcio/calcio_rss.xml
Get news for “soccer” category.
7 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 7 generate_get_news 'soccer', 'http://www.ansa.it/sito/notizie/sport/calcio/calcio_rss.xml', '1.0.0' |
.get_sport_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/notizie/sport/sport_rss.xml
Get news for “sport” category.
8 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 8 generate_get_news 'sport', 'http://www.ansa.it/sito/notizie/sport/sport_rss.xml', '1.0.0' |
.get_world_news ⇒ Array<Ansa::News>
This method is autogenerated, it fetches www.ansa.it/sito/notizie/mondo/mondo_rss.xml
Get news for “world” category.
5 |
# File 'lib/ansa/docs/dynamic_docs.rb', line 5 generate_get_news 'world', 'http://www.ansa.it/sito/notizie/mondo/mondo_rss.xml', '1.0.0' |