workinstartups-api 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/workinstartups-api.rb +32 -29
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e653c890ede644a370cfa91be509d7108023102
4
- data.tar.gz: a14ee92709a649322c5084b19fcc4ea3cdeac183
3
+ metadata.gz: 7224afa879878e20d48c3c3a3eac19787769f254
4
+ data.tar.gz: 751ec556a2fbf736d26b8ff31d58ae5c199c75e9
5
5
  SHA512:
6
- metadata.gz: 13437d17b77f7fc530a781aded4d2c6dfa39fcec6accce3219a19bebefc33da4b418452e5db1db398a0d2c4c969860b7b49a63cae13fb122f1b70d4400f44757
7
- data.tar.gz: 1c2aa3a57ef6e927eb6c7a873cdf5023bf145cf73f5320100484a3b9e89d3a006dc33ef6e20ec2d40f280a9df0f1fa85bc4212c18a4a6d4a6c0ff1a78930a93d
6
+ metadata.gz: e97b5e8810f055429922bc1063aa88dbcee6121c34836a99b97ae5196d8a9ecde627de9ce41bf500b115a836a089dbe2bc45e1c138f245a6f5f6fff2f08c3c29
7
+ data.tar.gz: c9ed65b4749269d0d3eb538cbfe2cd560d356bc811bf7abd66725acf6f91238c0cd31d657469cee51a099ccf9cfe53fb6e8dba9be125e4714052f34f2822b12c
@@ -1,8 +1,38 @@
1
1
  require 'open-uri'
2
2
  require 'json'
3
+ # Categories:
4
+ # 1: Programmers
5
+ # 2: Designers
6
+ # 3: Interns
7
+ # 4: undefined
8
+ # 5: Testers
9
+ # 6: undefined
10
+ # 7: Marketers
11
+ # 8: Managers
12
+ # 9: Consultants
13
+ # 10: undefined
14
+ # 11: undefined
15
+ # 12: undefined
16
+ # 13: undefined
17
+ # 14: undefined
18
+ # 15: Sales
19
+ # 16: Co-Founders
3
20
 
21
+ # Type:
22
+ # 0: all
23
+ # fulltime
24
+ # parttime
25
+ # freelance
26
+
27
+ # Ordering:
28
+ # 0: by post date
29
+ # 1: randomly
4
30
  class WorkInStartupsAPI
5
- def initialize(category=0, count = 20, random = false, type = 0)
31
+ DEFAULT_CATEGORY = 0
32
+ DEFAULT_COUNT = 20
33
+ DEFAULT_ORDER = false
34
+ DEFAULT_TYPE = 0
35
+ def initialize(category=DEFAULT_CATEGORY, count = DEFAULT_COUNT, random = DEFAULT_ORDER, type = DEFAULT_TYPE)
6
36
  @category = category
7
37
  @count = count
8
38
  @random = (random ? 1 : 0)
@@ -16,33 +46,6 @@ class WorkInStartupsAPI
16
46
  def set_format format
17
47
  @format = format
18
48
  end
19
- # Categories:
20
- # 1: Programmers
21
- # 2: Designers
22
- # 3: Interns
23
- # 4: undefined
24
- # 5: Testers
25
- # 6: undefined
26
- # 7: Marketers
27
- # 8: Managers
28
- # 9: Consultants
29
- # 10: undefined
30
- # 11: undefined
31
- # 12: undefined
32
- # 13: undefined
33
- # 14: undefined
34
- # 15: Sales
35
- # 16: Co-Founders
36
-
37
- # Type:
38
- # 0: all
39
- # fulltime
40
- # parttime
41
- # freelance
42
-
43
- # Ordering:
44
- # 0: by post date
45
- # 1: randomly
46
49
  def self.category_from_string string
47
50
  stripped = string.downcase.gsub(/\W+/, '')
48
51
  category = case stripped
@@ -124,6 +127,6 @@ class WorkInStartupsAPI
124
127
  if @latest.nil?
125
128
  get_latest
126
129
  end
127
- format @latest.select{|obj| obj["id"] == id}.first
130
+ format @latest.detect{|obj| obj["id"] == id}.first
128
131
  end
129
132
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workinstartups-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hugo Di Francesco
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/workinstartups-api.rb
20
- homepage: http://hugodf.github.io/workinstartups-api
20
+ homepage: https://github.com/HugoDF/workinstartups-api
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}