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
Methods included from ApiHelper
Methods included from Symbolize
Instance Method Details
#post_initialize ⇒ Object
5 6 7 |
# File 'lib/diffbot_simple/v2/article.rb', line 5 def post_initialize @api = :article end |
#request(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 request 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 |