Class: Diffbot::Article
- Inherits:
-
Object
- Object
- Diffbot::Article
- Includes:
- Base
- Defined in:
- lib/diffbot_api/article.rb
Overview
Class to parse a Diffbot article from a given URL
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#[](key) ⇒ String
Get article fields.
-
#initialize(url) ⇒ Article
constructor
Instantiate an Article from a URL.
Constructor Details
#initialize(url) ⇒ Article
Instantiate an Article from a URL
18 19 20 21 22 23 |
# File 'lib/diffbot_api/article.rb', line 18 def initialize(url) validate_diffbot_token! @url = URI.parse(url) extract_article end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/diffbot_api/article.rb', line 9 def url @url end |
Instance Method Details
#[](key) ⇒ String
Get article fields
28 29 30 |
# File 'lib/diffbot_api/article.rb', line 28 def [](key) @response[key] end |