Class: WhatAWorld::Country
- Inherits:
-
Object
- Object
- WhatAWorld::Country
- Defined in:
- lib/what_a_world/country.rb
Instance Attribute Summary collapse
-
#issues ⇒ Object
Returns the value of attribute issues.
-
#last_updated ⇒ Object
Returns the value of attribute last_updated.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#region ⇒ Object
Returns the value of attribute region.
-
#url_extension ⇒ Object
readonly
Returns the value of attribute url_extension.
Instance Method Summary collapse
- #get_issues ⇒ Object
-
#initialize(hash) ⇒ Country
constructor
A new instance of Country.
- #scrape ⇒ Object
Constructor Details
#initialize(hash) ⇒ Country
Returns a new instance of Country.
4 5 6 7 |
# File 'lib/what_a_world/country.rb', line 4 def initialize(hash) @name = hash.keys.join @url_extension = hash.values.join end |
Instance Attribute Details
#issues ⇒ Object
Returns the value of attribute issues.
2 3 4 |
# File 'lib/what_a_world/country.rb', line 2 def issues @issues end |
#last_updated ⇒ Object
Returns the value of attribute last_updated.
2 3 4 |
# File 'lib/what_a_world/country.rb', line 2 def last_updated @last_updated end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/what_a_world/country.rb', line 3 def name @name end |
#region ⇒ Object
Returns the value of attribute region.
2 3 4 |
# File 'lib/what_a_world/country.rb', line 2 def region @region end |
#url_extension ⇒ Object (readonly)
Returns the value of attribute url_extension.
3 4 5 |
# File 'lib/what_a_world/country.rb', line 3 def url_extension @url_extension end |
Instance Method Details
#get_issues ⇒ Object
17 18 19 20 |
# File 'lib/what_a_world/country.rb', line 17 def get_issues self.issues = WhatAWorld::Issues.new(self.url_extension) self.issues.scrape end |
#scrape ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/what_a_world/country.rb', line 9 def scrape scraper = WhatAWorld::Scraper::ScraperCountry.new(self.url_extension) self.last_updated = scraper.find_date self.region = scraper.find_region end |