Created new entry point CensusCaller

Here's a better alternative than the first one. Added a new abstraction level from which are performed both types of census calls, while the logic of those is managed in their own library.
This commit is contained in:
María Checa
2017-07-10 12:22:30 +02:00
parent 7e701db608
commit 089c690b49
7 changed files with 87 additions and 32 deletions

View File

@@ -18,7 +18,7 @@ class Verification::Management::Document
end
def in_census?
response = CensusApi.new.call(document_type, document_number)
response = CensusCaller.new.call(document_type, document_number)
response.valid? && valid_age?(response)
end