class Yoti::DocScan::Session::Create::SdkConfigBuilder

Builder to assist in the creation of {SdkConfig}.

Public Class Methods

new() click to toggle source
# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 82
def initialize
  @topics = []
end

Public Instance Methods

build() click to toggle source

@return [SdkConfig]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 205
def build
  SdkConfig.new(
    @allowed_capture_methods,
    @primary_colour,
    @secondary_colour,
    @font_colour,
    @locale,
    @preset_issuing_country,
    @success_url,
    @error_url
  )
end
with_allowed_capture_methods(allowed_capture_methods) click to toggle source

Sets the allowed capture method

@param [String] allowed_capture_methods

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 111
def with_allowed_capture_methods(allowed_capture_methods)
  @allowed_capture_methods = allowed_capture_methods
  self
end
with_allows_camera() click to toggle source

Sets the allowed capture method to “CAMERA”

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 91
def with_allows_camera
  with_allowed_capture_methods(Constants::CAMERA)
end
with_allows_camera_and_upload() click to toggle source

Sets the allowed capture method to “CAMERA_AND_UPLOAD”

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 100
def with_allows_camera_and_upload
  with_allowed_capture_methods(Constants::CAMERA_AND_UPLOAD)
end
with_error_url(error_url) click to toggle source

Sets the error URL for the redirect that follows the web/native client uploading documents unsuccessfully

@param [String] error_url

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 197
def with_error_url(error_url)
  @error_url = error_url
  self
end
with_font_colour(font_colour) click to toggle source

Sets the font colour to be used by the web/native client (used on the button)

@param [String] font_colour

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 147
def with_font_colour(font_colour)
  @font_colour = font_colour
  self
end
with_locale(locale) click to toggle source

Sets the locale on the builder

@param [String] locale

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 159
def with_locale(locale)
  @locale = locale
  self
end
with_preset_issuing_country(preset_issuing_country) click to toggle source

Sets the preset issuing country on the builder

@param [String] preset_issuing_country

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 171
def with_preset_issuing_country(preset_issuing_country)
  @preset_issuing_country = preset_issuing_country
  self
end
with_primary_colour(primary_colour) click to toggle source

Sets the primary colour to be used by the web/native client

@param [String] primary_colour

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 123
def with_primary_colour(primary_colour)
  @primary_colour = primary_colour
  self
end
with_secondary_colour(secondary_colour) click to toggle source

Sets the secondary colour to be used by the web/native client (used on the button)

@param [String] secondary_colour

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 135
def with_secondary_colour(secondary_colour)
  @secondary_colour = secondary_colour
  self
end
with_success_url(success_url) click to toggle source

Sets the success URL for the redirect that follows the web/native client uploading documents successfully

@param [String] success_url

@return [self]

# File lib/yoti/doc_scan/session/create/sdk_config.rb, line 184
def with_success_url(success_url)
  @success_url = success_url
  self
end