Class: AlchemyApi::TextExtraction

Inherits:
Base
  • Object
show all
Defined in:
lib/alchemy_api/text_extraction.rb

Class Method Summary collapse

Methods inherited from Base

check_json_for_errors_and_raise!, get_json

Class Method Details

.get_text_from_url_handler(response) ⇒ Object



79
80
81
82
83
# File 'lib/alchemy_api/text_extraction.rb', line 79

def self.get_text_from_url_handler(response)
  json = get_json(response)
  check_json_for_errors_and_raise!(json)
  ExtractedText.new(json['url'], json['text'])
end

.get_title_from_url_handler(response) ⇒ Object



74
75
76
77
# File 'lib/alchemy_api/text_extraction.rb', line 74

def self.get_title_from_url_handler(response)
  json = get_json(response)
  ExtractedTitle.new(json['url'], json['title'])
end