Class: RailsSpider::Work

Inherits:
ApplicationRecord show all
Defined in:
app/models/rails_spider/work.rb

Instance Method Summary collapse

Instance Method Details

#parseObject



17
18
19
20
21
# File 'app/models/rails_spider/work.rb', line 17

def parse
  locals.each do |local|
    local.run
  end
end

#parserObject



13
14
15
# File 'app/models/rails_spider/work.rb', line 13

def parser
  @parser ||= self.parser_name.to_s.safe_constantize
end

#resourceObject



5
6
7
# File 'app/models/rails_spider/work.rb', line 5

def resource
  @resource ||= Resource.new(self)
end

#runObject



9
10
11
# File 'app/models/rails_spider/work.rb', line 9

def run
  @resource.run
end