Class: Yoti::DocScan::Session::Create::SdkConfigBuilder
- Inherits:
-
Object
- Object
- Yoti::DocScan::Session::Create::SdkConfigBuilder
- Defined in:
- lib/yoti/doc_scan/session/create/sdk_config.rb
Overview
Builder to assist in the creation of SdkConfig.
Instance Method Summary collapse
- #build ⇒ SdkConfig
-
#initialize ⇒ SdkConfigBuilder
constructor
A new instance of SdkConfigBuilder.
-
#with_allowed_capture_methods(allowed_capture_methods) ⇒ self
Sets the allowed capture method.
-
#with_allows_camera ⇒ self
Sets the allowed capture method to “CAMERA”.
-
#with_allows_camera_and_upload ⇒ self
Sets the allowed capture method to “CAMERA_AND_UPLOAD”.
-
#with_error_url(error_url) ⇒ self
Sets the error URL for the redirect that follows the web/native client uploading documents unsuccessfully.
-
#with_font_colour(font_colour) ⇒ self
Sets the font colour to be used by the web/native client (used on the button).
-
#with_locale(locale) ⇒ self
Sets the locale on the builder.
-
#with_preset_issuing_country(preset_issuing_country) ⇒ self
Sets the preset issuing country on the builder.
-
#with_primary_colour(primary_colour) ⇒ self
Sets the primary colour to be used by the web/native client.
-
#with_secondary_colour(secondary_colour) ⇒ self
Sets the secondary colour to be used by the web/native client (used on the button).
-
#with_success_url(success_url) ⇒ self
Sets the success URL for the redirect that follows the web/native client uploading documents successfully.
Constructor Details
#initialize ⇒ SdkConfigBuilder
Returns a new instance of SdkConfigBuilder.
82 83 84 |
# File 'lib/yoti/doc_scan/session/create/sdk_config.rb', line 82 def initialize @topics = [] end |
Instance Method Details
#build ⇒ SdkConfig
205 206 207 208 209 210 211 212 213 214 215 216 |
# 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) ⇒ self
Sets the allowed capture method
111 112 113 114 |
# 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 ⇒ self
Sets the allowed capture method to “CAMERA”
91 92 93 |
# 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 ⇒ self
Sets the allowed capture method to “CAMERA_AND_UPLOAD”
100 101 102 |
# 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) ⇒ self
Sets the error URL for the redirect that follows the web/native client uploading documents unsuccessfully
197 198 199 200 |
# 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) ⇒ self
Sets the font colour to be used by the web/native client (used on the button)
147 148 149 150 |
# 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) ⇒ self
Sets the locale on the builder
159 160 161 162 |
# 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) ⇒ self
Sets the preset issuing country on the builder
171 172 173 174 |
# 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) ⇒ self
Sets the primary colour to be used by the web/native client
123 124 125 126 |
# 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) ⇒ self
Sets the secondary colour to be used by the web/native client (used on the button)
135 136 137 138 |
# 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) ⇒ self
Sets the success URL for the redirect that follows the web/native client uploading documents successfully
184 185 186 187 |
# File 'lib/yoti/doc_scan/session/create/sdk_config.rb', line 184 def with_success_url(success_url) @success_url = success_url self end |