Class: LinkOracle::Extractor::Base
- Inherits:
-
Object
- Object
- LinkOracle::Extractor::Base
- Defined in:
- lib/link_oracle/extractor/base.rb
Instance Attribute Summary collapse
-
#link_data ⇒ Object
readonly
Returns the value of attribute link_data.
-
#parsed_body ⇒ Object
readonly
Returns the value of attribute parsed_body.
Instance Method Summary collapse
- #get_content(selector) ⇒ Object
-
#initialize(parsed_body) ⇒ Base
constructor
A new instance of Base.
- #perform ⇒ Object
- #type ⇒ Object
Constructor Details
Instance Attribute Details
#link_data ⇒ Object (readonly)
Returns the value of attribute link_data.
4 5 6 |
# File 'lib/link_oracle/extractor/base.rb', line 4 def link_data @link_data end |
#parsed_body ⇒ Object (readonly)
Returns the value of attribute parsed_body.
4 5 6 |
# File 'lib/link_oracle/extractor/base.rb', line 4 def parsed_body @parsed_body end |
Instance Method Details
#get_content(selector) ⇒ Object
23 24 25 26 |
# File 'lib/link_oracle/extractor/base.rb', line 23 def get_content(selector) found = parsed_body.xpath(selector).first found ? [found[:content]] : [] end |
#perform ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/link_oracle/extractor/base.rb', line 15 def perform link_data.assign({ titles: title, image_urls: image, descriptions: description }) end |
#type ⇒ Object
11 12 13 |
# File 'lib/link_oracle/extractor/base.rb', line 11 def type raise "implement me" end |