workable 1.0.0 → 2.0.0rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
1
+ module Workable
2
+ class Transformation
3
+ def initialize(mappings)
4
+ @mappings = mappings || {}
5
+ end
6
+
7
+ # selects transformation strategy based on the inputs
8
+ # @param transformation [Method|Proc|nil] the transformation to perform
9
+ # @param data [Hash|Array|nil] the data to transform
10
+ # @return [Object|nil]
11
+ # results of the transformation if given, raw data otherwise
12
+ def apply(mapping, data)
13
+ transformation = @mappings[mapping]
14
+ return data unless transformation
15
+
16
+ case data
17
+ when nil
18
+ data
19
+ when Array
20
+ data.map { |datas| transformation.call(datas) }
21
+ else
22
+ transformation.call(data)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Workable
2
- VERSION = "1.0.0"
2
+ VERSION = '2.0.0rc1'
3
3
  end
@@ -1,138 +1,50 @@
1
1
  # coding: utf-8
2
- # dead-simple methods instead of full vcr cassettes, because why not?
2
+ # JSONs stolen from official workable API docs
3
+
4
+ def about_json_fixture
5
+ read_fixture 'about.json'
6
+ end
3
7
 
4
8
  def jobs_index_json_fixture
5
- JSON.generate({
6
- "name" => "wojsznis",
7
- "description" => nil,
8
- "jobs" => [
9
- {
10
- "key" => "7c60",
11
- "title" => "Ruby on Rails dev",
12
- "full_title" => "Ruby on Rails dev - CODE",
13
- "code" => "CODE",
14
- "shortcode" => "03FF356C8B",
15
- "state" => "published",
16
- "department" => "DEPT",
17
- "url" => "https://wojsznis.workable.com/jobs/30606",
18
- "application_url" => "https://wojsznis.workable.com/jobs/30606/candidates/new",
19
- "shortlink" => "https://wojsznis.workable.com/j/03FF356C8B",
20
- "location" => {
21
- "country" => "Poland",
22
- "country_code" => "PL",
23
- "region" => "Małopolskie",
24
- "region_code" => "MA",
25
- "city" => "Kraków",
26
- "zip_code" => "30-000",
27
- "telecommuting" => true
28
- },
29
- "created_at" => "2015-01-05"
30
- }
31
- ]
32
- })
9
+ read_fixture 'jobs.json'
33
10
  end
34
11
 
35
12
  def job_json_fixture
36
- JSON.generate({
37
- "key" => "7c60",
38
- "title" => "Ruby on Rails dev",
39
- "full_title" => "Ruby on Rails dev - CODE",
40
- "code" => "CODE",
41
- "shortcode" => "03FF356C8B",
42
- "state" => "draft",
43
- "department" => "DEPT",
44
- "url" => "https://wojsznis.workable.com/jobs/30606",
45
- "application_url" => "https://wojsznis.workable.com/jobs/30606/candidates/new",
46
- "shortlink" => "https://wojsznis.workable.com/j/03FF356C8B",
47
- "location" => {
48
- "country" => "Poland",
49
- "country_code" => "PL",
50
- "region" => "Małopolskie",
51
- "region_code" => "MA",
52
- "city" => "Kraków",
53
- "zip_code" => "30-338",
54
- "telecommuting" => true
55
- },
56
- "created_at" => "2015-01-05",
57
- "full_description" => "<p>Example job brief.</p>\r\n<ul>\n<li>test 1</li>\r\n<li>test 2</li>\r\n<li>test 3</li>\r\n</ul><p></p>\r\n<p><b>End of test.</b></p><p><strong>Requirements</strong></p><ul>\n<li>req 1</li>\r\n<li>req 2</li>\r\n</ul><p><strong>Benefits</strong></p><ul>\n<li>ben 1</li>\r\n<li>ben 2</li>\r\n</ul>",
58
- "description" => "<p>Example job brief.</p>\r\n<ul>\n<li>test 1</li>\r\n<li>test 2</li>\r\n<li>test 3</li>\r\n</ul><p></p>\r\n<p><b>End of test.</b></p>",
59
- "requirements" => "<ul>\n<li>req 1</li>\r\n<li>req 2</li>\r\n</ul>",
60
- "benefits" => "<ul>\n<li>ben 1</li>\r\n<li>ben 2</li>\r\n</ul>",
61
- "employment_type" => "Full-time",
62
- "industry" => "Information Technology and Services",
63
- "function" => "Engineering",
64
- "experience" => "Mid-Senior level",
65
- "education" => "Professional"
66
- })
13
+ read_fixture 'job.json'
67
14
  end
68
15
 
69
16
  def job_candidates_json_fixture
70
- JSON.generate({
71
- "candidates" => [
72
- {
73
- "key" => "f7087",
74
- "name" => "Test LastName",
75
- "firstname" => "Test",
76
- "lastname" => "LastName",
77
- "headline" => "headline",
78
- "account" => {
79
- "subdomain" => "wojsznis",
80
- "name" => "wojsznis"
81
- },
82
- "job" => {
83
- "shortcode" => "03FF356C8B",
84
- "title" => "Ruby on Rails dev"
85
- },
86
- "stage" => "Applied",
87
- "disqualified" => false,
88
- "sourced" => false,
89
- "profile_url" => "http://wojsznis.workable.com/backend/jobs/30606/candidates/1010613",
90
- "address" => "Address",
91
- "phone" => "",
92
- "email" => "example@test.com",
93
- "outbound_mailbox" => "eaqpdpbc@outbound.workablemail.com",
94
- "domain" => "unknown",
95
- "created_at" => "2015-01-05 11:56:40",
96
- "updated_at" => "2015-01-05 11:56:48",
97
- "cover_letter" => "",
98
- "summary" => "",
99
- "education_entries" => [ ],
100
- "experience_entries" => [ ],
101
- "skills" => [ ],
102
- "answers" => [
103
- {
104
- "question" => {
105
- "body" => "Why you want this job?"
106
- },
107
- "answer" => {
108
- "body" => "<p>Sample answer</p>"
109
- }
110
- }
111
- ],
112
- "resume_url" => "",
113
- "tags" => [ ]
114
- }
115
- ]
116
- })
17
+ read_fixture 'job_candidates.json'
18
+ end
19
+
20
+ def job_candidate_json_fixture
21
+ read_fixture 'job_candidate.json'
117
22
  end
118
23
 
119
24
  def stages_json_fixture
120
- JSON.generate({"stages" => [
121
- {"slug"=>"sourced", "name"=>"Sourced", "kind"=>"sourced", "position"=>1},
122
- {"slug"=>"applied", "name"=>"Applied", "kind"=>"applied", "position"=>2},
123
- {"slug"=>"soft-talk", "name"=>"Soft Talk", "kind"=>"interview", "position"=>3},
124
- {"slug"=>"wait", "name"=>"Wait", "kind"=>"shortlisted", "position"=>4},
125
- {"slug"=>"assessment", "name"=>"Assessment", "kind"=>"assessment", "position"=>5},
126
- {"slug"=>"review", "name"=>"Review", "kind"=>"assessment", "position"=>6},
127
- {"slug"=>"tech-talk", "name"=>"Tech Talk", "kind"=>"interview", "position"=>7},
128
- {"slug"=>"prepare", "name"=>"Prepare", "kind"=>"interview", "position"=>8},
129
- {"slug"=>"ready", "name"=>"Ready", "kind"=>"shortlisted", "position"=>9},
130
- {"slug"=>"later", "name"=>"Later", "kind"=>"shortlisted", "position"=>10}
131
- ]})
25
+ read_fixture 'stages.json'
132
26
  end
133
27
 
134
28
  def job_questions_json_fixture
135
- JSON.generate({"questions" => [
136
- {"key"=>"fe8", "body"=>"How many fingers do you have?", "type"=>"free_text"}
137
- ]})
29
+ read_fixture 'job_questions.json'
30
+ end
31
+
32
+ def recruiters_json_fixture
33
+ read_fixture 'recruiters.json'
34
+ end
35
+
36
+ def members_json_fixture
37
+ read_fixture 'members.json'
38
+ end
39
+
40
+ def new_candiate_hash_fixture
41
+ JSON.parse(read_fixture('new_candidate.json'))
42
+ end
43
+
44
+ def new_candiate_response_json_fixture
45
+ read_fixture 'new_candidate_response.json'
46
+ end
47
+
48
+ def read_fixture(filename)
49
+ File.read File.expand_path("../fixtures/#{filename}", __FILE__)
138
50
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "id": "20ff5c50",
3
+ "name": "Groove Tech",
4
+ "subdomain": "groove-tech",
5
+ "description": "<p>We’ve all spent tons of hours trying to book a trip! Well, our guys finally got tired of going through this frustrating process and passionately decided to do something about it: To change the traveller’s experience. Four years later, we stick to that idea by daily plotting the traveling revolution.</p> <p>Like busy little bees, all 98 of us, customise our user-friendly software and innovative services to match leisure and business travellers needs throughout the entire journey. We create innovative and top notch travel products for a simple reason: You deserve it.</p> <p>Whether it’s about booking tickets or hotels, whatever the budget, us travel lovers are dedicated to deliver you a lifetime experience. How? By empowering you to easily discover, book and have fun at the whole world!</p> <p>We are innovators, idealists and perfectionists. We love raising the bar to delight and amaze our customers and that’s exactly why working with us requires a lot of you. But it’s a lot more than that. We’ll brightly reward you. We’ll develop your career. We’ll keep you excited! In other words we promise being the most exciting place for you to work at.</p> <p>We are growing as crazy and we need you industry experts and passionate individuals to do things that matter and take us off! Come aboard ready to share, learn and grow.</p>",
6
+ "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam elementum posuere erat, quis mattis lectus ullamcorper sit amet. Praesent nec aliquet erat. Donec quis arcu id metus tristique eleifend. Aenean sed nunc id tortor vulputate auctor. Pellentesque ut volutpat augue, vel aliquam lectus. Maecenas mattis dictum risus, id varius nisi sodales vitae. Aenean pulvinar lacinia condimentum. Nulla id leo a tortor elementum dapibus id condimentum nibh.",
7
+ "website_url": "https://www.workable.com"
8
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "id": "167636b1",
3
+ "title": "Office Manager",
4
+ "full_title": "Office Manager - US/4/OM",
5
+ "shortcode": "GROOV005",
6
+ "code": "US/4/OM",
7
+ "state": "published",
8
+ "department": "Administration",
9
+ "url": "https://groove-tech.lvh.me:3000/jobs/376844767",
10
+ "application_url": "https://groove-tech.lvh.me:3000/jobs/376844767/candidates/new",
11
+ "shortlink": "https://groove-tech.lvh.me:3000/j/GROOV005",
12
+ "location": {
13
+ "country": "United States",
14
+ "country_code": "US",
15
+ "region": "Illinois",
16
+ "region_code": "IL",
17
+ "city": "Chicago",
18
+ "zip_code": "60290",
19
+ "telecommuting": false
20
+ },
21
+ "created_at": "2015-06-08T00:00:00Z",
22
+ "full_description": " <p>We are looking for an Office Manager to organize and coordinate office operations and procedures, in order to ensure organizational effectiveness, efficiency and safety.The ideal candidate will be experienced in handling a wide range of administrative and executive support related tasks and will be able to work independently with little or no supervision. This person must be exceedingly well organized, flexible and enjoy the administrative challenges of supporting an office of diverse people.</p> <p>Responsibilities:<ul> <li>Serve as the point person for maintenance, mailing, shopping, supplies, equipment, bills, and errands</li> <li>Organize and schedule meetings and appointments</li> <li>Partner with HR to maintain office policies as necessary</li> <li>Organize office operations and proceduresCoordinate with IT department on all office equipment</li> <li>Manage relationships with vendors, service providers, and landlord, ensuring that all items are invoiced and paid on time</li> <li>Manage contract and price negotiations with office vendors, service providers and office lease</li> <li>Manage office G&A budget, ensure accurate and timely reporting</li> <li>Provide general support to visitors</li> </ul></p><p><strong>Requirements</strong></p><ul> <li>4+ years of office management, administrative or assistant experience</li> <li>Knowledge of office management systems and procedures</li> <li>Excellent time management skills and ability to multi-task and prioritize work</li> <li>Attention to detail and problem solving skills</li> <li>Excellent written and verbal communication skills</li> <li>Strong organizational and planning skills</li> <li>Proficiency in MS Office</li> </ul><p><strong>Benefits</strong></p><ul>\\\n <li>Great opportunities for career development</li> <li>All your equipment provided including a laptop</li> <li>Increasing vacation days with each year of employment</li> </ul>",
23
+ "description": " <p>We are looking for an Office Manager to organize and coordinate office operations and procedures, in order to ensure organizational effectiveness, efficiency and safety.The ideal candidate will be experienced in handling a wide range of administrative and executive support related tasks and will be able to work independently with little or no supervision. This person must be exceedingly well organized, flexible and enjoy the administrative challenges of supporting an office of diverse people.</p> <p>Responsibilities:<ul> <li>Serve as the point person for maintenance, mailing, shopping, supplies, equipment, bills, and errands</li> <li>Organize and schedule meetings and appointments</li> <li>Partner with HR to maintain office policies as necessary</li> <li>Organize office operations and proceduresCoordinate with IT department on all office equipment</li> <li>Manage relationships with vendors, service providers, and landlord, ensuring that all items are invoiced and paid on time</li> <li>Manage contract and price negotiations with office vendors, service providers and office lease</li> <li>Manage office G&A budget, ensure accurate and timely reporting</li> <li>Provide general support to visitors</li> </ul></p>",
24
+ "requirements": "<ul> <li>4+ years of office management, administrative or assistant experience</li> <li>Knowledge of office management systems and procedures</li> <li>Excellent time management skills and ability to multi-task and prioritize work</li> <li>Attention to detail and problem solving skills</li> <li>Excellent written and verbal communication skills</li> <li>Strong organizational and planning skills</li> <li>Proficiency in MS Office</li> </ul>",
25
+ "benefits": "<ul> <li>Great opportunities for career development</li> <li>All your equipment provided including a laptop</li> <li>Increasing vacation days with each year of employment</li> </ul>",
26
+ "employment_type": "Full-time",
27
+ "industry": "Business Supplies and equipment",
28
+ "function": "Administrative",
29
+ "experience": "Associate",
30
+ "education": "High School or equivalent"
31
+ }
@@ -0,0 +1,119 @@
1
+ {
2
+ "candidate": {
3
+ "id": "108d1748",
4
+ "name": "Cindy Sawyers",
5
+ "firstname": "Cindy",
6
+ "lastname": "Sawyers",
7
+ "headline": "Operations Manager",
8
+ "image_url": null,
9
+ "account": {
10
+ "subdomain": "groove-tech",
11
+ "name": "Groove Tech"
12
+ },
13
+ "job": {
14
+ "shortcode": "GROOV005",
15
+ "title": "Office Manager"
16
+ },
17
+ "stage": "Applied",
18
+ "disqualified": false,
19
+ "disqualified_at": null,
20
+ "disqualification_reason": null,
21
+ "sourced": false,
22
+ "profile_url": "https://groove-tech.workable.com/backend/jobs/376844767/candidates/277680758",
23
+ "address": "332 Clemmie Roads, Colorado, USA",
24
+ "phone": "(785)991-6256",
25
+ "email": "cindy_sawyers@gmail.com",
26
+ "outbound_mailbox": "azjp_gws@outbound.workable.mailgun.org",
27
+ "domain": "twitter.com",
28
+ "uploader_id": null,
29
+ "created_at": "2015-07-01T00:00:00Z",
30
+ "updated_at": "2015-07-06T12:16:51Z",
31
+ "cover_letter": null,
32
+ "summary": "A focussed, results-driven team player with many year experience in the field. Working my way up to management level, I have experience of every aspect of this role. I understand the challenges it brings, and have a proven track record of providing solutions.",
33
+ "education_entries": [
34
+ {
35
+ "degree": "B.A. Business Studies",
36
+ "school": "University of Chicago",
37
+ "field_of_study": null,
38
+ "start_date": "2001-01-01",
39
+ "end_date": "2005-01-01"
40
+ },
41
+ {
42
+ "degree": "Diploma",
43
+ "school": "Juliet Hargreaves High School",
44
+ "field_of_study": null,
45
+ "start_date": "1997-01-01",
46
+ "end_date": "2001-01-01"
47
+ }
48
+ ],
49
+ "experience_entries": [
50
+ {
51
+ "title": "Executive Assistant",
52
+ "summary": "<ul><li>Dealt with contacts and correspondence.</li><li>Managed suppliers, contractors and office systems.</li><li>Maintained handbooks, policies and practices, ensuring they were understood and adhered to by all staff.</li><li>Coordinated and project managed the office relocation and renovation.</li></ul>",
53
+ "start_date": "2013-01-01",
54
+ "end_date": null,
55
+ "company": "Overflow Furnishings",
56
+ "industry": null,
57
+ "current": true
58
+ },
59
+ {
60
+ "title": "Resources Manager",
61
+ "summary": "<ul><li>Coordinated agendas and papers, minute taking and maintaining records for the management committee.</li><li>Managed vendor/supplier relationships.</li><li>Responsible for overall management of the office, including budgets and building and facilities management.</li><li>Ensured compliance with health and safety and other workplace legislation, including regular risk assessments.</li></ul>",
62
+ "start_date": "2009-01-01",
63
+ "end_date": "2013-01-01",
64
+ "company": "Kidlaw Supplies",
65
+ "industry": null,
66
+ "current": false
67
+ },
68
+ {
69
+ "title": "Administrative Officer",
70
+ "summary": "<ul><li>Managed the implementation and development of an effective recruitment program.</li><li>Organised Fire and First Aid training.</li><li>Developed induction and handover processes for staff, interns, trustees and volunteers.</li><li>Planned and managed the CEO\\\\’s diary of internal and external meetings.</li></ul>",
71
+ "start_date": "2005-01-01",
72
+ "end_date": "2009-01-01",
73
+ "company": "Spakes IT Services",
74
+ "industry": null,
75
+ "current": false
76
+ }
77
+ ],
78
+ "skills": [
79
+ {
80
+ "name": "Administration"
81
+ },
82
+ {
83
+ "name": "Organization"
84
+ },
85
+ {
86
+ "name": "Budgeting"
87
+ },
88
+ {
89
+ "name": "Project Management"
90
+ },
91
+ {
92
+ "name": "MS Office"
93
+ },
94
+ {
95
+ "name": "Event Management"
96
+ }
97
+ ],
98
+ "answers": [],
99
+ "resume_url": null,
100
+ "social_profiles": [
101
+ {
102
+ "type": "twitter",
103
+ "name": "Twitter",
104
+ "username": "cindy_sawyers",
105
+ "url": "http://www.twitter.com/cindy_sawyers"
106
+ },
107
+ {
108
+ "type": "linkedin",
109
+ "name": "LinkedIn",
110
+ "url": "http://www.linkedin.com/in/cindy_sawyers"
111
+ },
112
+ {
113
+ "type": "googleplus",
114
+ "url": "https://plus.google.com/1849771376195546"
115
+ }
116
+ ],
117
+ "tags": []
118
+ }
119
+ }
@@ -0,0 +1,58 @@
1
+
2
+
3
+ {
4
+ "candidates": [
5
+ {
6
+ "id": "ce4da98",
7
+ "name": "Lakita Marrero",
8
+ "firstname": "Lakita",
9
+ "lastname": "Marrero",
10
+ "headline": "Operations Manager",
11
+ "account": {
12
+ "subdomain": "groove-tech",
13
+ "name": "Groove Tech"
14
+ },
15
+ "job": {
16
+ "shortcode": "GROOV005",
17
+ "title": "Office Manager"
18
+ },
19
+ "stage": "Interview",
20
+ "disqualified": true,
21
+ "disqualification_reason": null,
22
+ "sourced": false,
23
+ "profile_url": "https://groove-tech.workable.com/backend/jobs/376844767/candidates/216323526",
24
+ "email": "lakita_marrero@gmail.com",
25
+ "domain": "twitter.com",
26
+ "created_at": "2015-06-26T00:00:00Z",
27
+ "updated_at": "2015-07-08T14:46:48Z"
28
+ },
29
+ {
30
+ "id": "108d1748",
31
+ "name": "Cindy Sawyers",
32
+ "firstname": "Cindy",
33
+ "lastname": "Sawyers",
34
+ "headline": "Talented Operations Executive",
35
+ "account": {
36
+ "subdomain": "groove-tech",
37
+ "name": "Groove Tech"
38
+ },
39
+ "job": {
40
+ "shortcode": "GROOV005",
41
+ "title": "Office Manager"
42
+ },
43
+ "stage": "Applied",
44
+ "disqualified": false,
45
+ "disqualification_reason": null,
46
+ "sourced": false,
47
+ "profile_url": "https://groove-tech.workable.com/backend/jobs/376844767/candidates/277680758",
48
+ "email": "cindy_sawyers@gmail.com",
49
+ "domain": "indeed.com",
50
+ "created_at": "2015-07-08T00:00:00Z",
51
+ "updated_at": "2015-07-08T14:46:48Z"
52
+ }
53
+ ],
54
+ "paging": {
55
+ "next": "https://www.workable.com/spi/v3/accounts/subdomain/jobs/subdomain/candidates?limit=3&since_id=2700d6df"
56
+ }
57
+ }
58
+
@@ -0,0 +1,34 @@
1
+ {
2
+ "questions": [
3
+ {
4
+ "id": "2128d717",
5
+ "body": "Explain one aspect of this role you believe you will excel at.",
6
+ "type": "free_text"
7
+ },
8
+ {
9
+ "id": "3399e6cd",
10
+ "body": "How many years administrative experience do you have?",
11
+ "type": "multiple_choice",
12
+ "single_answer": true,
13
+ "choices": [
14
+ {
15
+ "id": "3049114a",
16
+ "body": "0-3 years"
17
+ },
18
+ {
19
+ "id": "29406296",
20
+ "body": "3-5 years"
21
+ },
22
+ {
23
+ "id": "1e477229",
24
+ "body": "Over 5 years"
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "id": "1d3f348f",
30
+ "body": "Intermediate or above proficiency with MS Office?",
31
+ "type": "boolean"
32
+ }
33
+ ]
34
+ }