class Simplyhired::Job
Attributes
company[R]
date_posted[R]
details[R]
details_url[R]
excerpt[R]
location[R]
source[R]
title[R]
Public Class Methods
new(jhash)
click to toggle source
# File lib/simplyhired/job.rb, line 4 def initialize(jhash) encoding_options = { invalid: :replace, # Replace invalid byte sequences undef: :replace, # Replace anything not defined in ASCII replace: '', # Use a blank for those replacements universal_newline: true # Always break lines with \n } @title = jhash[:title] && jhash[:title].encode(Encoding.find('ASCII'), encoding_options).gsub("&", "&") @excerpt = jhash[:excerpt] @location = jhash[:location] @company = jhash[:company] && jhash[:company].encode(Encoding.find('ASCII'), encoding_options).gsub("&", "&") @source = jhash[:source] @details_url = jhash["source:url"] @date_posted = jhash[:date_posted] end