Class: DiffbotSimple::V2::Article

Inherits:
Object
  • Object
show all
Includes:
ApiHelper
Defined in:
lib/diffbot_simple/v2/article.rb

Overview

Instance Method Summary collapse

Methods included from ApiHelper

#initialize, #to_crawl_api_url

Instance Method Details

#post_initializeObject



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, **options
	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'
		options[:method] = :post
	end
	execute_call options.merge(url: url, custom_headers: custom_headers, payload: body)
end