class Abbyy::Client
Constants
- API_ENDPOINT
Attributes
current_task[R]
task[R]
Public Class Methods
new(application_id = Abbyy.application_id, password = Abbyy.password)
click to toggle source
# File lib/abbyy/client.rb, line 14 def initialize(application_id = Abbyy.application_id, password = Abbyy.password) @appliction_id = application_id @password = password @task = {} end
Public Instance Methods
get(url = task[:resultUrl])
click to toggle source
Retrieve the result of processing task
@param [String] the url of the task result @return [String] the xml representation
# File lib/abbyy/client.rb, line 36 def get(url = task[:resultUrl]) RestClient.get(url) end
list_tasks()
click to toggle source
ocrsdk.com/documentation/apireference/listTasks/ @return [Array] the list of tasks created
# File lib/abbyy/client.rb, line 42 def list_tasks parse_task get("#{url}/listTasks") end
method_missing(meth, *args, &block)
click to toggle source
# File lib/abbyy/client.rb, line 46 def method_missing(meth, *args, &block) api = API.new self self.resource = api.execute meth, *args, &block current_task end
url()
click to toggle source
@return [String] the api url with credentials
# File lib/abbyy/client.rb, line 21 def url @url ||= begin uri = URI::HTTP.build host: API_ENDPOINT uri.user = CGI.escape @appliction_id.to_s uri.password = CGI.escape @password.to_s if uri.user uri.to_s end end
Private Instance Methods
resource=(resource)
click to toggle source
# File lib/abbyy/client.rb, line 54 def resource=(resource) @task = parse_task(resource) end