Class: DiffbotSimple::V2::Article
- Inherits:
-
Object
- Object
- DiffbotSimple::V2::Article
- Includes:
- ApiHelper
- Defined in:
- lib/diffbot_simple/v2/article.rb
Overview
Complies to www.diffbot.com/dev/docs/article
Instance Method Summary collapse
- #post_initialize ⇒ Object
- #single_article(url: nil, custom_headers: nil, body: nil, **options) ⇒ Object
Methods included from ApiHelper
#initialize, #to_crawl_api_url
Instance Method Details
#post_initialize ⇒ Object
5 6 7 |
# File 'lib/diffbot_simple/v2/article.rb', line 5 def post_initialize @api = :article end |
#single_article(url: nil, custom_headers: nil, body: nil, **options) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/diffbot_simple/v2/article.rb', line 8 def single_article url: nil, custom_headers: nil, body: nil, ** raise ArgumentError.new "Must pass an url for the article api to fetch" unless url if body custom_headers ||= {} custom_headers['Content-Type'] = 'text/html' [:method] = :post end execute_call .merge(url: url, custom_headers: custom_headers, payload: body) end |