Class: Speechmatics::ApiFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/speechmatics/api_factory.rb

Class Method Summary collapse

Class Method Details

.api(name, parent, options = {}) {|api| ... } ⇒ Object

Yields:



6
7
8
9
10
11
# File 'lib/speechmatics/api_factory.rb', line 6

def self.api(name, parent, options={}, &block)
  api = name.constantize.new(parent.current_options)
  api.apply_options(options)
  yield(api) if block_given?
  api
end