yuniversity 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/yuniversity.rb +11 -2
- data/lib/yuniversity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f293697b906e79aaa6fb34af2d52b8fd31658d02
|
4
|
+
data.tar.gz: ec7fd5b326a2b1ed4ffa63f5742cec6e933f708d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97b65220777a519fcb05fef36694957b1823f2427f98d80e84e0192f9b40d890bcfb368e1adfb63e03a962885b64b561789ba21368f130a93ef3f862479215d1
|
7
|
+
data.tar.gz: cda079264592f61059c0d834230c2b11a53cbe8f8000ef053fcf40a02a51ec0ce952476724cc22584a528a8f85b58623f5cea909c348fc15f83db217a5ca804d
|
data/README.md
CHANGED
@@ -31,6 +31,12 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
YUniversity::RAW - for raw data
|
33
33
|
|
34
|
+
YUniversity.find_by_country('philippines') - this will return all the schools from philippines.
|
35
|
+
|
36
|
+
YUniversity.find_by_countries(['philippines', 'japan', 'korea']) - this will return all the schools from japan and korea
|
37
|
+
|
38
|
+
YUniversity.find_country_by_university('New York University Tirana') - this will return the country for New York University Tirana
|
39
|
+
|
34
40
|
## Contributing
|
35
41
|
|
36
42
|
1. Fork it
|
data/lib/yuniversity.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "yuniversity/version"
|
2
2
|
require 'yaml'
|
3
|
-
|
3
|
+
require 'pry'
|
4
4
|
module YUniversity
|
5
5
|
RAW = YAML.load_file(File.join(File.dirname(__FILE__), 'YUniversity', 'data', 'universities.yml'))
|
6
6
|
|
@@ -12,7 +12,16 @@ module YUniversity
|
|
12
12
|
|
13
13
|
NAMES = ALL.map{|u| u['name']}
|
14
14
|
|
15
|
-
def self.
|
15
|
+
def self.find_by_country(country)
|
16
16
|
ALL.select{|c| c['country'].downcase.match(country.downcase)}
|
17
17
|
end
|
18
|
+
|
19
|
+
def self.find_by_countries(countries)
|
20
|
+
ALL.select{|c| countries.map{|e| e.downcase }.include?(c['country'].downcase)}
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.find_country_by_university(university)
|
24
|
+
university = ALL.find{|c| c['name'].downcase.match(university.downcase)}
|
25
|
+
university['country'] unless university.nil?
|
26
|
+
end
|
18
27
|
end
|
data/lib/yuniversity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yuniversity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rewin0087
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|