yahoo_countries_and_provinces 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2f239a96839073bf7ab77aa7d9bf2610fc03cc1
4
- data.tar.gz: 377c52e44a672428a7ee29add7e1b460ec82cf66
3
+ metadata.gz: a6ed4080e2aba87088ecdf7aba9cd6fc9fc0bfbd
4
+ data.tar.gz: 0aef4606910e33ac24a1c9f3ca4c68c8f2fa7345
5
5
  SHA512:
6
- metadata.gz: 03e55675f500db7a68604df51a2a5f826adb531b101a5579ba2ecbc969ae22cf66ffbfa112d45ed33e41a43ee72f1c7d11f7fbe2e59d033705be20a776b2e17f
7
- data.tar.gz: b36ea14357cfd431a20873091093bd216d636eb09012260cb7cf3df251902eb4b1dc7c0497dbbb28fe11daa1f962e046382de84155ed35b4aa1e4896c33fcc98
6
+ metadata.gz: dc610d2246c52fa914cac95d384cf48dfc05ef8c50204ad23fca1dc9c1dba9a559c42bf2be1f672248b8096f70ccd9a731174ffe53a5778ffb68956c9059a4cf
7
+ data.tar.gz: 6e4ddb69d335d876b78813002af9007c9389ac72a96daa1fd37b482ed5173327df499448b133bc75dbe1658f4791b9f53b5a9149060656391e116528367899b9
data/README.md CHANGED
@@ -18,7 +18,9 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
-
21
+ #require the file
22
+ require "yahoo_countries_and_provinces"
23
+
22
24
  #To get a list of the countries in english
23
25
  country_array = YahooCountriesAndStates::countries("en")
24
26
 
@@ -1,3 +1,3 @@
1
1
  module YahooCountriesAndProvinces
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -4,13 +4,13 @@ require 'json'
4
4
  module YahooCountriesAndProvinces
5
5
  class YahooProvinceList
6
6
  def initialize()
7
- @states_array = []
7
+ @province_array = []
8
8
  end
9
9
 
10
10
  def provinces(country, language = "en")
11
11
  set_url(country, language)
12
12
 
13
- @states_array.clear if @states_array.any?
13
+ @province_array.clear if @province_array.any?
14
14
  begin
15
15
  resp = Net::HTTP.get_response(URI.parse(@url))
16
16
  data = resp.body
@@ -19,11 +19,11 @@ module YahooCountriesAndProvinces
19
19
  raise "Could not get the data from yahoo's servers"
20
20
  end
21
21
 
22
- result.each { |state|
23
- @states_array << state['name']
22
+ result.each { |province|
23
+ @province_array << province['name']
24
24
  }
25
25
 
26
- @states_array
26
+ @province_array
27
27
  end
28
28
 
29
29
  private
@@ -9,11 +9,11 @@ class YahooCountriesAndProvincesTest < Test::Unit::TestCase
9
9
  assert YahooCountriesAndProvinces::countries("de").include?("Kleinere Inselbesitzungen der Vereinigten Staaten")
10
10
  end
11
11
 
12
- def test_get_state_baghdad_in_english
12
+ def test_get_province_baghdad_in_english
13
13
  assert YahooCountriesAndProvinces::provinces("Iraq", "en").include?("Baghdad")
14
14
  end
15
15
 
16
- def test_get_state_stockholm_in_arabic
16
+ def test_get_province_stockholm_in_arabic
17
17
  assert YahooCountriesAndProvinces::provinces("Sweden", "ar").include?("ستوكهولم")
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo_countries_and_provinces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jone Samra