Files
nairobi/lib/census_caller.rb
María Checa 089c690b49 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.
2017-07-10 12:22:30 +02:00

8 lines
230 B
Ruby

class CensusCaller
def call(document_type, document_number)
response = CensusApi.new.call(document_type, document_number)
response = LocalCensus.new.call(document_type, document_number) unless response.valid?
end
end