countries_ru 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/countries_ru/version.rb +1 -1
- data/lib/countries_ru.rb +1 -1
- data/spec/countries_ru_spec.rb +10 -2
- metadata +1 -1
data/lib/countries_ru/version.rb
CHANGED
data/lib/countries_ru.rb
CHANGED
|
@@ -5,7 +5,7 @@ module CountriesRu
|
|
|
5
5
|
Data = YAML.load_file(File.join(File.dirname(__FILE__), 'data', 'countries.yml')) || {}
|
|
6
6
|
|
|
7
7
|
def method_missing(method_name, *args, &block)
|
|
8
|
-
proxy_methods = [:[], :keys]
|
|
8
|
+
proxy_methods = [:[], :keys, :each]
|
|
9
9
|
if proxy_methods.include? method_name
|
|
10
10
|
Data.send method_name, *args
|
|
11
11
|
end
|
data/spec/countries_ru_spec.rb
CHANGED
|
@@ -5,7 +5,15 @@ describe CountriesRu do
|
|
|
5
5
|
CountriesRu['AU'].should be_kind_of(Hash)
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
describe "#keys" do
|
|
9
|
+
it "should proxy to .keys of data hash" do
|
|
10
|
+
CountriesRu.keys.should be_kind_of(Array)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe "#each" do
|
|
15
|
+
it "should proxy to .each of countries hash" do
|
|
16
|
+
CountriesRu.each.should be_kind_of(Enumerator)
|
|
17
|
+
end
|
|
10
18
|
end
|
|
11
19
|
end
|