lib/firstjob_api/publication.rb in firstjob_api-1.0.4 vs lib/firstjob_api/publication.rb in firstjob_api-1.0.5
- old
+ new
@@ -1,20 +1,23 @@
module FirstjobApi
class Publication
attr_accessor :title, :description, :career_status_id,
:looking_for_id, :location, :years_experience, :salary,
:english_level_id, :excel_level_id, :careers_ids,
- :universities_ids, :id, :slug, :status, :postulantes
+ :universities_ids, :id, :slug, :postulantes, :questions,
+ :publish_response
+
def initialize(attributes={})
# Default values
@salary = 0
@location = "Chile"
@career_status_id = 1
@years_experience = 0
@english_level_id = 1
@excel_level_id = 1
+ @questions = []
attributes.each do |key, value|
self.send("#{key}=", value)
end
end
@@ -38,11 +41,11 @@
response_body = HttpParser.parse_json_response(response)
# load results
@slug = response_body["slug"]
@id = response_body["id"]
- @status = response_body["status"]
+ @publish_response = response
return self
end
def url
"#{FirstjobApi.base_uri}/jobs/#{slug}"
@@ -87,9 +90,12 @@
if careers_ids.present?
hash[:careers] = careers_ids # optional, array or NOT PRESENT
end
if universities_ids.present?
hash[:universities] = universities_ids # optional, array or NOT PRESENT
+ end
+ if questions.present?
+ hash[:questions] = questions # optional, array or NOT PRESENT
end
return hash
end
end