Class: ChambaSearchMx::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/chamba_search_mx/finder.rb

Overview

finds jobs and returns simplified objects of them selfs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Finder

Returns a new instance of Finder.



8
9
10
11
12
13
# File 'lib/chamba_search_mx/finder.rb', line 8

def initialize(options = {})
  @formatter = options[:formatter] || ChambaSearchMx::UrlFormatter.new
  @pagination = options[:pagination] || ChambaSearchMx::Pagination.new
  @search_page = options[:search_page] || ChambaSearchMx::SearchPage.new
  @job = options[:job] || ChambaSearchMx::JobPage.new
end

Instance Attribute Details

#jobsObject (readonly)

Returns the value of attribute jobs.



7
8
9
# File 'lib/chamba_search_mx/finder.rb', line 7

def jobs
  @jobs
end

Instance Method Details

#find(search, options = {}) ⇒ Class

Returns self.

Parameters:

  • search (String)
  • options (Hash) (defaults to: {})

Returns:

  • (Class)

    self



19
20
21
22
23
24
25
# File 'lib/chamba_search_mx/finder.rb', line 19

def find(search, options = {})
  @search = search
  @options = options
  validate_arguments
  find_jobs
  self
end