Class: FuturesPipeline::Client

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

Instance Method Summary collapse

Methods included from Request

#get

Instance Method Details

#career(onet_soc_code, options = {}) ⇒ Hashie::Mash

Get a single career using O*NET code.

Examples:

FuturesPipeline.career("11-1011.00")

Parameters:

  • onet_soc_code (String)

    The O*NET code

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

    A customizable set of options.

Returns:

  • (Hashie::Mash)

Raises:

  • (Faraday::Error::ResourceNotFound)

    If O*NET code is not found.



29
30
31
32
# File 'lib/futures_pipeline/client.rb', line 29

def career(onet_soc_code, options={})
  api_safe_onet_soc_code = onet_soc_code.tr(".", "-")
  get("/api/v1/careers/#{api_safe_onet_soc_code}.json", options)
end

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

Get a list of all the available careers. Returns an array of 50 careers per request. Use offset option to get more.

Examples:

FuturesPipeline.careers

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • rpp (Integer)

    The results per page from the first career in the list.

  • page (Integer)

    the page of results from the first career in the list.

Returns:

  • (Array<Hashie::Mash>)


17
18
19
# File 'lib/futures_pipeline/client.rb', line 17

def careers(options={})
  get("/api/v1/careers.json", options)
end

#search(moc, options = {}) ⇒ Hashie::Mash

Search for careers by MOC code. Returns a list of careers related to the MOC.

Examples:

FuturesPipeline.search("11b")

Parameters:

  • moc (String)

    The MOC

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

    A customizable set of options.

Returns:

  • (Hashie::Mash)


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

def search(moc, options={})
   get("/api/v1/careers/search.json?moc=#{moc}", options)
end