class Yoti::DocScan::Session::Create::OrthogonalRestrictionsFilter

Public Class Methods

builder() click to toggle source

@return [OrthogonalRestrictionsFilterBuilder]

# File lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb, line 32
def self.builder
  OrthogonalRestrictionsFilterBuilder.new
end
new(country_restriction, type_restriction) click to toggle source

@param [CountryRestriction] country_restriction @param [TypeRestriction] type_restriction

# 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

Public Instance Methods

as_json(*_args) click to toggle source
# 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