Sha256: ce125143673535faf155e68d00fc42d8ef27f6f131298526d0b187f05f398f1b
Contents?: true
Size: 1.12 KB
Versions: 4
Compression:
Stored size: 1.12 KB
Contents
require 'ocr_space/file_post' module OcrSpace module Convert def convert(apikey: @api_key, language: 'eng', isOverlayRequired: false, file: nil, url: nil) if file @files = File.new(file) @data = OcrSpace::FilePost.post('/parse/image', body: { apikey: apikey, language: language, isOverlayRequired: isOverlayRequired, file: @files }) @data = @data.parsed_response['ParsedResults'] elsif url @data = HTTParty.post('https://api.ocr.space/parse/image', body: { apikey: apikey, language: language, isOverlayRequired: isOverlayRequired, url: url }) @data = @data.parsed_response['ParsedResults'] else "You need to Pass either file or url." end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ocr_space-2.3.1 | lib/ocr_space/convert.rb |
ocr_space-2.3 | lib/ocr_space/convert.rb |
ocr_space-2.1 | lib/ocr_space/convert.rb |
ocr_space-2.0 | lib/ocr_space/convert.rb |