class Yoti::DocScan::Session::Create::RequestedTask
Requests creation of a Task to be performed on each document
Public Class Methods
new(type, config)
click to toggle source
@param [String] type The type of the Task to create @param [#as_json] config Configuration
to apply to the Task
# File lib/yoti/doc_scan/session/create/requested_task.rb, line 15 def initialize(type, config) raise(TypeError, "#{self.class} cannot be instantiated") if instance_of?(RequestedTask) Validation.assert_is_a(String, type, 'type') @type = type Validation.assert_respond_to(:as_json, config, 'config') @config = config end
Public Instance Methods
as_json(*_args)
click to toggle source
# File lib/yoti/doc_scan/session/create/requested_task.rb, line 29 def as_json(*_args) { type: @type, config: @config.as_json } end
to_json(*_args)
click to toggle source
# File lib/yoti/doc_scan/session/create/requested_task.rb, line 25 def to_json(*_args) as_json.to_json end