Class: Kimurai::Pipeline

Inherits:
Object
  • Object
show all
Includes:
BaseHelper
Defined in:
lib/kimurai/pipeline.rb

Direct Known Subclasses

Saver, Validator

Defined Under Namespace

Classes: DropItemError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#spiderObject

Returns the value of attribute spider.



9
10
11
# File 'lib/kimurai/pipeline.rb', line 9

def spider
  @spider
end

Class Method Details

.nameObject



4
5
6
# File 'lib/kimurai/pipeline.rb', line 4

def self.name
  self.to_s.sub(/.*?::/, "").underscore.to_sym
end

Instance Method Details

#loggerObject



29
30
31
# File 'lib/kimurai/pipeline.rb', line 29

def logger
  spider.logger
end

#nameObject



11
12
13
# File 'lib/kimurai/pipeline.rb', line 11

def name
  self.class.name
end

#save_to(path, item, format:, position: true, append: false) ⇒ Object



25
26
27
# File 'lib/kimurai/pipeline.rb', line 25

def save_to(path, item, format:, position: true, append: false)
  spider.save_to(path, item, format: format, position: position, append: append)
end

#storageObject



17
18
19
# File 'lib/kimurai/pipeline.rb', line 17

def storage
  spider.storage
end

#unique?(scope, value) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/kimurai/pipeline.rb', line 21

def unique?(scope, value)
  spider.unique?(scope, value)
end