Class: JobboardsParser::Jobboard::JoelOnSoftware

Inherits:
Jobboard
  • Object
show all
Defined in:
lib/jobboards/boards/joel_on_software.rb

Instance Attribute Summary

Attributes inherited from Jobboard

#company, #description, #location, #published_at, #title, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Jobboard

#attributes, extract_description, feed, jobboard_name, open_feed

Constructor Details

#initialize(title, url, location, company, description, published_at) ⇒ JoelOnSoftware

Returns a new instance of JoelOnSoftware.



5
6
7
8
# File 'lib/jobboards/boards/joel_on_software.rb', line 5

def initialize(title, url, location, company, description, published_at)
  super(title, url, location, company, description, published_at)
  @jobboard = self.class.jobboard_name
end

Class Method Details

.parseObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jobboards/boards/joel_on_software.rb', line 10

def self.parse
 (open_feed.items || []).inject([]) do |acc, item|
    title         = item.title.split(" at ").first.strip
    url           = item.link
    location      = item.title.split("(").last.split(")").first.strip
    company       = item.title.split(" at ").last.split("(").first.strip
    description   = item.description
    published_at  = item.updated
    
    acc << self.new(title, url, location, company, description, published_at).attributes
    acc
  end
end