Class: IndeedAPI::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/indeed_api/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Job

Returns a new instance of Job.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/indeed_api/job.rb', line 9

def initialize(data = {})
  @job_title = data['jobtitle']
  @company = data['company']
  @city = data['city']
  @state = data['state']
  @country = data['country']
  @formatted_location = data['formattedLocation']
  @source = data['source']
  @date = data['date'] ? Time.parse(data['date']) : nil
  @snippet = data['snippet']
  @url = data['url']
  @onmousedown = data['onmousedown']
  @latitude = data['latitude'] ? data['latitude'].to_f : nil
  @longitude = data['longitude'] ? data['longitude'].to_f : nil
  @job_key = data['jobkey']
  @sponsored = data['sponsored'] == 'true'
  @expired = data['expired'] == 'true'
  @formatted_location_full = data['formattedLocationFull']
  @formatted_relative_time = data['formattedRelativeTime']
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def city
  @city
end

#companyObject (readonly)

Returns the value of attribute company.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def company
  @company
end

#countryObject (readonly)

Returns the value of attribute country.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def country
  @country
end

#dateObject (readonly)

Returns the value of attribute date.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def date
  @date
end

#expiredObject (readonly)

Returns the value of attribute expired.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def expired
  @expired
end

#formatted_locationObject (readonly)

Returns the value of attribute formatted_location.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def formatted_location
  @formatted_location
end

#formatted_location_fullObject (readonly)

Returns the value of attribute formatted_location_full.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def formatted_location_full
  @formatted_location_full
end

#formatted_relative_timeObject (readonly)

Returns the value of attribute formatted_relative_time.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def formatted_relative_time
  @formatted_relative_time
end

#job_keyObject (readonly)

Returns the value of attribute job_key.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def job_key
  @job_key
end

#job_titleObject (readonly)

Returns the value of attribute job_title.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def job_title
  @job_title
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def longitude
  @longitude
end

#onmousedownObject (readonly)

Returns the value of attribute onmousedown.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def onmousedown
  @onmousedown
end

#snippetObject (readonly)

Returns the value of attribute snippet.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def snippet
  @snippet
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def source
  @source
end

Returns the value of attribute sponsored.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def sponsored
  @sponsored
end

#stateObject (readonly)

Returns the value of attribute state.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def state
  @state
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/indeed_api/job.rb', line 5

def url
  @url
end