Class: Nice::Recruitment::JobOffer

Inherits:
Object
  • Object
show all
Defined in:
lib/nice/recruitment/job_offer.rb

Overview

A job offer from recrutement.nicecotedazur.org.

Offers built from the listing page carry summary fields only (updated_at, recruitment_nature); offers built from a detail page carry the full set (contract, organization, description, ...). Fields absent from the source page are nil.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ JobOffer

Returns a new instance of JobOffer.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/nice/recruitment/job_offer.rb', line 17

def initialize(attributes = {})
  @id = attributes['id']
  @title = attributes['title']
  @url = attributes['url']
  @reference = attributes['reference']
  @category = attributes['category']
  @deadline = parse_date(attributes['deadline'])
  @updated_at = parse_date(attributes['updated_at'])
  @recruitment_nature = attributes['recruitment_nature']
  @contract = attributes['contract']
  @organization = attributes['organization']
  @department = attributes['department']
  @location = attributes['location']
  @workplace = attributes['workplace']
  @sector = attributes['sector']
  @domain = attributes['domain']
  @employment_framework = attributes['employment_framework']
  @introduction = attributes['introduction']
  @description = attributes['description']
  @profile = attributes['profile']
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def category
  @category
end

#contractObject (readonly)

Returns the value of attribute contract.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def contract
  @contract
end

#deadlineObject (readonly)

Returns the value of attribute deadline.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def deadline
  @deadline
end

#departmentObject (readonly)

Returns the value of attribute department.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def department
  @department
end

#descriptionObject (readonly)

Returns the value of attribute description.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def description
  @description
end

#domainObject (readonly)

Returns the value of attribute domain.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def domain
  @domain
end

#employment_frameworkObject (readonly)

Returns the value of attribute employment_framework.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def employment_framework
  @employment_framework
end

#idObject (readonly)

Returns the value of attribute id.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def id
  @id
end

#introductionObject (readonly)

Returns the value of attribute introduction.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def introduction
  @introduction
end

#locationObject (readonly)

Returns the value of attribute location.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def location
  @location
end

#organizationObject (readonly)

Returns the value of attribute organization.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def organization
  @organization
end

#profileObject (readonly)

Returns the value of attribute profile.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def profile
  @profile
end

#recruitment_natureObject (readonly)

Returns the value of attribute recruitment_nature.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def recruitment_nature
  @recruitment_nature
end

#referenceObject (readonly)

Returns the value of attribute reference.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def reference
  @reference
end

#sectorObject (readonly)

Returns the value of attribute sector.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def sector
  @sector
end

#titleObject (readonly)

Returns the value of attribute title.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def title
  @title
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def updated_at
  @updated_at
end

#urlObject (readonly)

Returns the value of attribute url.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def url
  @url
end

#workplaceObject (readonly)

Returns the value of attribute workplace.



12
13
14
# File 'lib/nice/recruitment/job_offer.rb', line 12

def workplace
  @workplace
end

Instance Method Details

#to_hObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/nice/recruitment/job_offer.rb', line 39

def to_h
  {
    'id' => @id,
    'title' => @title,
    'url' => @url,
    'reference' => @reference,
    'category' => @category,
    'deadline' => @deadline,
    'updated_at' => @updated_at,
    'recruitment_nature' => @recruitment_nature,
    'contract' => @contract,
    'organization' => @organization,
    'department' => @department,
    'location' => @location,
    'workplace' => @workplace,
    'sector' => @sector,
    'domain' => @domain,
    'employment_framework' => @employment_framework,
    'introduction' => @introduction,
    'description' => @description,
    'profile' => @profile
  }
end