Class: DirectEmployers::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, Request
Defined in:
lib/direct_employers/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

#get

Constructor Details

#initialize(options = {}) ⇒ Client

Set your development key on New

Examples:

DirectEmployers.New({:key => "abc123"})

Parameters:

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

    A customizable set of options.



15
16
17
# File 'lib/direct_employers/client.rb', line 15

def initialize(options={})
  @key = options[:key]
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/direct_employers/client.rb', line 6

def key
  @key
end

Instance Method Details

#search(options = {}) ⇒ Array<Hashie::Mash>

Get a list of all jobs that match the query string parameters

Examples:

DirectEmployers.search({:moc => "11b"})

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • kw (String)

    Keywords in a standard Boolean format.

  • oc (String)

    Occupation from a list of ##. Must be only Can be used to map to categories if client site uses categories

  • tm (String)

    Time range from 1 (for 1 day) upwards, with 0 meaning no time range

  • ind (String)

    One of JobCentral’s industry ids, I would suggest using Onets over industries any day

  • cn (String)

    Country, US is 100, so if you want to eliminate foreign jobs, include this cn=100

  • zc (String)

    Zipcode or City,State or State (TN or Tennessee) Examples : zc=TN, zc=23454, zc=Nashville%2CTN Default radius is 25 miles, value should be URLEncoded

  • zc1 (Object)

    and rd1 [String] Same as above, only you can provide a number of miles from this set of numbers for rd1 : 5,10,15,25,50,100,300, value should be URLEncoded Zc1=Indianapolis%2CIN&rd1=50

  • cname (String)

    All or part of a company name, value should be URLEncoded

  • i (String)

    Values e or s for employers or staffing firms only

  • moc (String)

    Moc code, retrieves a mapped Onet code, which is used to search

  • rank (String)

    Further qualifies the mappings for moc

  • branch (String)

    Further qualifies the mappings for moc

  • so (String)

    One of two values, “relevance”, or “initdate”, Default if nothing is passed is relevance

  • rs (String)

    Start row, from 1 to 500

  • re (String)

    End row, from 1 to 500

  • si (String)

    Search id, as described above

Returns:

  • (Array<Hashie::Mash>)


41
42
43
# File 'lib/direct_employers/client.rb', line 41

def search(options={})
  get("api.asp", options)
end