Class: Yoti::DocScan::Session::Create::OrthogonalRestrictionsFilter

Inherits:
DocumentFilter
  • Object
show all
Defined in:
lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DocumentFilter

#to_json

Constructor Details

#initialize(country_restriction, type_restriction) ⇒ OrthogonalRestrictionsFilter

Returns a new instance of OrthogonalRestrictionsFilter.

Parameters:



12
13
14
15
16
17
18
19
20
# File 'lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb', line 12

def initialize(country_restriction, type_restriction)
  super(Constants::ORTHOGONAL_RESTRICTIONS)

  Validation.assert_is_a(CountryRestriction, country_restriction, 'country_restriction', true)
  @country_restriction = country_restriction

  Validation.assert_is_a(TypeRestriction, type_restriction, 'type_restriction', true)
  @type_restriction = type_restriction
end

Class Method Details

.builderOrthogonalRestrictionsFilterBuilder



32
33
34
# File 'lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb', line 32

def self.builder
  OrthogonalRestrictionsFilterBuilder.new
end

Instance Method Details

#as_json(*_args) ⇒ Object



22
23
24
25
26
27
# File 'lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb', line 22

def as_json(*_args)
  json = super
  json[:country_restriction] = @country_restriction.as_json unless @country_restriction.nil?
  json[:type_restriction] = @type_restriction.as_json unless @type_restriction.nil?
  json
end