Class: WhatAWorld::Issues
- Inherits:
-
Object
- Object
- WhatAWorld::Issues
- Defined in:
- lib/what_a_world/issues.rb
Instance Attribute Summary collapse
-
#disputes_hash ⇒ Object
Returns the value of attribute disputes_hash.
-
#drugs_hash ⇒ Object
Returns the value of attribute drugs_hash.
-
#refugees_hash ⇒ Object
Returns the value of attribute refugees_hash.
-
#trafficking_hash ⇒ Object
Returns the value of attribute trafficking_hash.
-
#url_extension ⇒ Object
readonly
Returns the value of attribute url_extension.
Instance Method Summary collapse
-
#initialize(url_extension) ⇒ Issues
constructor
A new instance of Issues.
- #scrape ⇒ Object
Constructor Details
#initialize(url_extension) ⇒ Issues
Returns a new instance of Issues.
4 5 6 7 8 9 10 |
# File 'lib/what_a_world/issues.rb', line 4 def initialize(url_extension) @url_extension = url_extension @trafficking_hash = {} @drugs_hash = {} @refugees_hash = {} @disputes_hash = {} end |
Instance Attribute Details
#disputes_hash ⇒ Object
Returns the value of attribute disputes_hash.
2 3 4 |
# File 'lib/what_a_world/issues.rb', line 2 def disputes_hash @disputes_hash end |
#drugs_hash ⇒ Object
Returns the value of attribute drugs_hash.
2 3 4 |
# File 'lib/what_a_world/issues.rb', line 2 def drugs_hash @drugs_hash end |
#refugees_hash ⇒ Object
Returns the value of attribute refugees_hash.
2 3 4 |
# File 'lib/what_a_world/issues.rb', line 2 def refugees_hash @refugees_hash end |
#trafficking_hash ⇒ Object
Returns the value of attribute trafficking_hash.
2 3 4 |
# File 'lib/what_a_world/issues.rb', line 2 def trafficking_hash @trafficking_hash end |
#url_extension ⇒ Object (readonly)
Returns the value of attribute url_extension.
3 4 5 |
# File 'lib/what_a_world/issues.rb', line 3 def url_extension @url_extension end |
Instance Method Details
#scrape ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/what_a_world/issues.rb', line 12 def scrape scraper = WhatAWorld::Scraper::ScraperIssues.new(self.url_extension) scraper.scrape_issues self.trafficking_hash = scraper.trafficking_hash self.drugs_hash = scraper.drugs_hash self.refugees_hash = scraper.refugees_hash self.disputes_hash = scraper.disputes_hash end |