Class: SemaApiRuby::Client
- Inherits:
-
Object
- Object
- SemaApiRuby::Client
- Includes:
- Ocr
- Defined in:
- lib/sema_api_ruby/client.rb,
lib/sema_api_ruby/client/ocr.rb,
lib/sema_api_ruby/exceptions.rb
Defined Under Namespace
Modules: Ocr Classes: EmptyResponse, NoTokenError
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Ocr
#post_ocr_image, #text_to_image_ratio
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sema_api_ruby/client.rb', line 15 def initialize( = {}) # Use options passed in, but fall back to config module defaults = SemaApiRuby..merge() # Copy the merged values to this client and ignore those # not part of our configuration SemaApiRuby::Configuration::VALID_CONFIG_KEYS.each do |key| public_send("#{key}=", [key]) end if access_token.nil? raise NoTokenError, 'you must provide an access token' end end |