Class: Datalab::OcrOptions

Inherits:
Object
  • Object
show all
Includes:
DynamicSchema::Definable
Defined in:
lib/datalab/ocr_options.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, api_options: nil) ⇒ OcrOptions

Returns a new instance of OcrOptions.



18
19
20
21
# File 'lib/datalab/ocr_options.rb', line 18

def initialize( options = {}, api_options: nil )
  @options = self.class.builder.build( options || {} )
  @options = api_options.merge( @options ) if api_options 
end

Class Method Details

.build(options = nil, &block) ⇒ Object



10
11
12
# File 'lib/datalab/ocr_options.rb', line 10

def self.build( options = nil, &block )
  new( api_options: builder.build( options, &block ) )
end

.build!(options = nil, &block) ⇒ Object



14
15
16
# File 'lib/datalab/ocr_options.rb', line 14

def self.build!( options = nil, &block )
  new( api_options: builder.build!( options, &block ) )
end

Instance Method Details

#to_hObject



23
24
25
# File 'lib/datalab/ocr_options.rb', line 23

def to_h
  @options.to_h 
end