luzvimin 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Luzvimin
2
2
 
3
- TODO: Write a gem description
3
+ Luzvimin is a gem that lists all regions and provinces in the Philippines
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,27 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ To list all regions:
22
+
23
+ Luzvimin.regions
24
+
25
+ To create a select tag for all regions:
26
+
27
+ Luzvimin.select_regions
28
+
29
+ To get details about a region:
30
+
31
+ region = Luzvimin.region('NCR')
32
+ region.code is 'NCR'.
33
+ region.name is 'National Capital Region'.
34
+
35
+ To get a region's provinces:
36
+
37
+ region.provinces
38
+
39
+ To create a select tag for all region's provinces:
40
+
41
+ region.select_provinces
22
42
 
23
43
  ## Contributing
24
44
 
@@ -25,7 +25,7 @@ module Luzvimin
25
25
  provinces.map { |k, v| [k, v] }.sort_by{ |k, v| v['position'] }
26
26
  end
27
27
 
28
- def select_provinces
28
+ def provinces_options_for_select
29
29
  provinces.map {|s| [s[1]['name'],s[0]]}
30
30
  end
31
31
  end
@@ -39,7 +39,7 @@ module Luzvimin
39
39
  REGIONS
40
40
  end
41
41
 
42
- def select_regions
42
+ def regions_options_for_select
43
43
  REGIONS.map {|s| [s[1]['name'],s[0]]}
44
44
  end
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module Luzvimin
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -30,15 +30,15 @@ describe Luzvimin::Region do
30
30
  end
31
31
  end
32
32
 
33
- describe 'select_provinces' do
33
+ describe 'provinces_options_for_select' do
34
34
  context 'all' do
35
- subject { region.select_provinces }
35
+ subject { region.provinces_options_for_select }
36
36
  it { should be_an(Array) }
37
37
  it { should have(1).items }
38
38
  end
39
39
 
40
40
  context 'first province' do
41
- subject { region.select_provinces.first }
41
+ subject { region.provinces_options_for_select.first }
42
42
  it { should be_an(Array) }
43
43
  it { should_not be_empty }
44
44
  it { should have(2).items }
@@ -25,15 +25,15 @@ describe Luzvimin do
25
25
  it { Luzvimin.regions.first.should be_an(Array) }
26
26
  end
27
27
 
28
- describe 'select_regions' do
28
+ describe 'regions_options_for_select' do
29
29
  context 'all' do
30
- subject { Luzvimin.select_regions }
30
+ subject { Luzvimin.regions_options_for_select }
31
31
  it { should be_an(Array) }
32
32
  it { should have(17).items }
33
33
  end
34
34
 
35
35
  context 'first region' do
36
- subject { Luzvimin.select_regions.first }
36
+ subject { Luzvimin.regions_options_for_select.first }
37
37
  it { should be_an(Array) }
38
38
  it { should_not be_empty }
39
39
  it { should have(2).items }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luzvimin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-04 00:00:00.000000000 Z
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec