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

#assessmentHashie::Mash

Get the skill/interest assessment questions and possible answers

Examples:

FuturesPipeline.assessment

Returns:

  • (Hashie::Mash)


48
49
50
# File 'lib/futures_pipeline/client.rb', line 48

def assessment
   get("/api/v1/assessment.json")
end

#assessment_result(i1, i2, i3, i4, i5, i6, s1, s2, s3, s4, s5, s6, s7, s8) ⇒ Hashie::Mash

Get the results from the skill/interest assessment

Examples:

FuturesPipeline.assessment_results(1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4)

Parameters:

  • i1 (Integer)

    The numeric answer to interest question 1

  • i2 (Integer)

    The numeric answer to interest question 2

  • i3 (Integer)

    The numeric answer to interest question 3

  • i4 (Integer)

    The numeric answer to interest question 4

  • i5 (Integer)

    The numeric answer to interest question 5

  • i6 (Integer)

    The numeric answer to interest question 6

  • s1 (Integer)

    The numeric answer to skill question 1

  • s2 (Integer)

    The numeric answer to skill question 2

  • s3 (Integer)

    The numeric answer to skill question 3

  • s4 (Integer)

    The numeric answer to skill question 4

  • s5 (Integer)

    The numeric answer to skill question 5

  • s6 (Integer)

    The numeric answer to skill question 6

  • s7 (Integer)

    The numeric answer to skill question 7

  • s8 (Integer)

    The numeric answer to skill question 8

Returns:

  • (Hashie::Mash)


71
72
73
# File 'lib/futures_pipeline/client.rb', line 71

def assessment_result(i1, i2, i3, i4, i5, i6, s1, s2, s3, s4, s5, s6, s7, s8)
   get("/api/v1/careers/#{[i1, i2, i3, i4, i5, i6].join}/#{[s1, s2, s3, s4, s5, s6, s7, s8].join}.json")
end

#career(onet_soc_code) ⇒ 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

Returns:

  • (Hashie::Mash)

Raises:

  • (Faraday::Error::ResourceNotFound)

    If O*NET code is not found.



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

def career(onet_soc_code)
  api_safe_onet_soc_code = onet_soc_code.tr(".", "-")
  get("/api/v1/careers/#{api_safe_onet_soc_code}.json")
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) ⇒ 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

Returns:

  • (Hashie::Mash)


39
40
41
# File 'lib/futures_pipeline/client.rb', line 39

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