2018-03-28 15:24:43 +02:00
|
|
|
class ApiEntreprise::Adapter
|
|
|
|
def initialize(siret_or_siren, procedure_id)
|
|
|
|
@siret_or_siren = siret_or_siren
|
|
|
|
@procedure_id = procedure_id
|
|
|
|
end
|
2018-03-19 15:05:56 +01:00
|
|
|
|
|
|
|
def data_source
|
|
|
|
@data_source ||= get_resource
|
|
|
|
rescue
|
|
|
|
@data_source = nil
|
|
|
|
end
|
2018-03-19 15:45:55 +01:00
|
|
|
|
|
|
|
def to_params
|
|
|
|
if data_source.present?
|
|
|
|
process_params
|
|
|
|
else
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
end
|
2018-03-28 15:24:43 +02:00
|
|
|
end
|