Class: Workable::Job

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Job

Returns a new instance of Job.



11
12
13
14
15
16
# File 'lib/workable/job.rb', line 11

def initialize(params)
  params.each do |key, value|
    value = OpenStruct.new(value) if value.is_a?(Hash)
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#application_urlObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def application_url
  @application_url
end

#benefitsObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def benefits
  @benefits
end

#codeObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def code
  @code
end

#departmentObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def department
  @department
end

#descriptionObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def description
  @description
end

#educationObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def education
  @education
end

#employment_typeObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def employment_type
  @employment_type
end

#experienceObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def experience
  @experience
end

#full_descriptionObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def full_description
  @full_description
end

#full_titleObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def full_title
  @full_title
end

#functionObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def function
  @function
end

#industryObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def industry
  @industry
end

#keyObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def key
  @key
end

#locationObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def location
  @location
end

#requirementsObject (readonly)

from job details



8
9
10
# File 'lib/workable/job.rb', line 8

def requirements
  @requirements
end

#shortcodeObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def shortcode
  @shortcode
end

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def shortlink
  @shortlink
end

#stateObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def state
  @state
end

#titleObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def title
  @title
end

#urlObject (readonly)

from main jobs query



4
5
6
# File 'lib/workable/job.rb', line 4

def url
  @url
end

Instance Method Details

#created_atObject



22
23
24
# File 'lib/workable/job.rb', line 22

def created_at
  Date.parse(@created_at)
end

#location_nameObject



18
19
20
# File 'lib/workable/job.rb', line 18

def location_name
  "#{location.city}, #{location.country}"
end