Class: Nation
- Inherits:
-
Object
show all
- Defined in:
- lib/nation.rb
Defined Under Namespace
Classes: HtmlFile, JsonFile, NationGeneral, NationInfo
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Nation
Returns a new instance of Nation.
3
4
5
|
# File 'lib/nation.rb', line 3
def initialize
@stored_info = {}
end
|
Instance Method Details
#nation_info(nation_name) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/nation.rb', line 7
def nation_info(nation_name)
nation_name = nation_name.downcase.split.map(&:capitalize).join("_")
general = NationGeneral.new(nation_name)
nation_general = general.get_raw_data
info = NationInfo.new(nation_name)
info_country = info.get_raw_data
@stored_info = {:name => nation_general[0], :capital => nation_general[1], :continent => nation_general[2], :region => nation_general[3], :population => nation_general[4], :languages => nation_general[5], :about_country => info_country}
@stored_info
end
|