Class: Aranha::DefaultProcessor
- Inherits:
-
Object
- Object
- Aranha::DefaultProcessor
- Defined in:
- lib/aranha/default_processor.rb
Instance Attribute Summary collapse
-
#extra_data ⇒ Object
readonly
Returns the value of attribute extra_data.
-
#source_uri ⇒ Object
readonly
Returns the value of attribute source_uri.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source_uri, extra_data) ⇒ DefaultProcessor
constructor
A new instance of DefaultProcessor.
- #process ⇒ Object
Constructor Details
#initialize(source_uri, extra_data) ⇒ DefaultProcessor
Returns a new instance of DefaultProcessor.
18 19 20 21 |
# File 'lib/aranha/default_processor.rb', line 18 def initialize(source_uri, extra_data) @source_uri = self.class.sanitize_uri(source_uri) @extra_data = extra_data end |
Instance Attribute Details
#extra_data ⇒ Object (readonly)
Returns the value of attribute extra_data.
7 8 9 |
# File 'lib/aranha/default_processor.rb', line 7 def extra_data @extra_data end |
#source_uri ⇒ Object (readonly)
Returns the value of attribute source_uri.
7 8 9 |
# File 'lib/aranha/default_processor.rb', line 7 def source_uri @source_uri end |
Class Method Details
.sanitize_uri(uri) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/aranha/default_processor.rb', line 10 def sanitize_uri(uri) return uri if uri.is_a?(Hash) uri = uri.to_s.gsub(%r{\A/}, 'file:///') unless uri.is_a?(Addressable::URI) Addressable::URI.parse(uri) end |
Instance Method Details
#process ⇒ Object
23 24 25 |
# File 'lib/aranha/default_processor.rb', line 23 def process raise 'Implement method process' end |