Class: WhatAWorld::Issues

Inherits:
Object
  • Object
show all
Defined in:
lib/what_a_world/issues.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_hashObject

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_hashObject

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_hashObject

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_hashObject

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_extensionObject (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

#scrapeObject



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