chamba_search_mx 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 314046f5b3c5a33b5eb7690cbd7c35e253b96819
4
- data.tar.gz: 314bd2a0905007d1ee93c5496985d9325630ccfd
3
+ metadata.gz: 8339f6912ab4bd03564b235ac3e2d25a1840afd7
4
+ data.tar.gz: 2332f435f2a53e99af4a871d3e70a78ce940f770
5
5
  SHA512:
6
- metadata.gz: f3bb0cec85ca5d9e2acf6d49acf0e294816ea5ec105e2d092eb874bc2dc746776c1e43fe52ac756ac0ea1413ae7b2ca3f497c3fc66549777ef6beed7dda69481
7
- data.tar.gz: ae7b800437747bc51959b47acdbc3420cc1518d0d319e3a170f3b8a45a9e80936792d612666d3c2e42e57e093a5b95c6cfd6291032757fd6906726600407ea47
6
+ metadata.gz: c9c2889694025b8adebb2b92df5e53246fc0cb390e28e46fe886190e3c438a91f098b273a0d176fd4d9361e1505dba3ff40a82c387aa8c78c0758fd647a277b1
7
+ data.tar.gz: a03a9d067007cba52b83d2d2a8c5e1ffc3efb37fb29a430ef375f20e3f0d9958bd7ddd6f2430cfd968cce9171f67e98cab0bf1b839e617a04e6457ef082d83ef
data/CHANGELOG.md CHANGED
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [v0.1.1]
8
+ - More documentation added
9
+
7
10
  ## [v0.1.0]
8
11
  ### Added
9
12
  - ChambaSearchMx module added by @richistron
@@ -11,4 +14,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
11
14
  - rspec tests added by @richistron
12
15
 
13
16
  [v0.1.0]:https://github.com/richistron/chamba_search_mx/tree/v0.1.0
17
+ [v0.1.1]:https://github.com/richistron/chamba_search_mx/tree/v0.1.0
14
18
 
@@ -2,6 +2,8 @@ module ChambaSearchMx
2
2
  ##
3
3
  # finds jobs and returns simplified objects of them selfs
4
4
  class Finder
5
+ ##
6
+ # @attribute <Array>
5
7
  attr_reader :jobs
6
8
  def initialize(options = {})
7
9
  @formatter = options[:formatter] || ChambaSearchMx::UrlFormatter.new
@@ -10,6 +12,10 @@ module ChambaSearchMx
10
12
  @job = options[:job] || ChambaSearchMx::JobPage.new
11
13
  end
12
14
 
15
+ ##
16
+ # @param <String> search
17
+ # @param <Hash> options
18
+ # @return <Class> self
13
19
  def find(search, options = {})
14
20
  @search = search
15
21
  @options = options
@@ -18,36 +24,50 @@ module ChambaSearchMx
18
24
  self
19
25
  end
20
26
 
27
+ private
28
+
29
+ ##
30
+ # @raise <ArgumentError>
21
31
  def validate_arguments
22
32
  error_msg = 'search must be a non empty string'
23
33
  raise ArgumentError, error_msg unless search_valid?
24
34
  end
25
35
 
36
+ ##
37
+ # @return <Boolean>
26
38
  def search_valid?
27
- if @search.class != String || @search.empty?
28
- false
29
- else
30
- true
31
- end
39
+ return false if @search.class != String
40
+ return false if @search.empty?
41
+ true
32
42
  end
33
43
 
44
+ ##
45
+ # @return <Array>
34
46
  def find_jobs
35
47
  @jobs = job_urls.map { |url| @job.load(url).data }
36
48
  end
37
49
 
50
+ ##
51
+ # @return <Array>
38
52
  def job_urls
39
53
  pagination_urls.map { |url| @search_page.load(url).job_urls }.flatten
40
54
  end
41
55
 
56
+ ##
57
+ # @return <Array>
42
58
  def pagination_urls
43
59
  @pagination.load(format_url).urls
44
60
  end
45
61
 
62
+ ##
63
+ # @returm <string>
46
64
  def format_url
47
65
  opts = search_options
48
66
  @formatter.format @search, opts
49
67
  end
50
68
 
69
+ ##
70
+ # @return <Hash>
51
71
  def search_options
52
72
  {
53
73
  location: @options[:location] || 'default',
@@ -1,3 +1,3 @@
1
1
  module ChambaSearchMx
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chamba_search_mx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Rivas G.