Class: Tango::ETL::HandlerInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/tango/etl/handler_interface.rb

Overview

Handler interface

Author:

  • Mckomo

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, document, cache = nil) ⇒ Tango::ETL::HandlerInterface

Constructor of Tango’s handler

Parameters:



18
19
20
21
22
# File 'lib/tango/etl/handler_interface.rb', line 18

def initialize( url, document, cache = nil )
  @url = url
  @document = document
  @cache = cache      
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



10
11
12
# File 'lib/tango/etl/handler_interface.rb', line 10

def url
  @url
end

Class Method Details

.applicable?(url) ⇒ Boolean

Wether handler should be applied for given url

Parameters:

  • url (String)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/tango/etl/handler_interface.rb', line 42

def self.applicable?( url )
  raise NotImplementedError
end

Instance Method Details

Return list of links to be crawled as next

Returns:

  • (Array|String)

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/tango/etl/handler_interface.rb', line 27

def links
  raise NotImplementedError
end

#triggerNilClass

Process document

Returns:

  • (NilClass)

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/tango/etl/handler_interface.rb', line 34

def trigger
  raise NotImplementedError 
end