demarches-normaliennes/app/lib/api_entreprise/rna_adapter.rb

28 lines
557 B
Ruby
Raw Normal View History

class ApiEntreprise::RNAAdapter < ApiEntreprise::Adapter
private
def get_resource
ApiEntreprise::API.rna(@siret, @procedure_id)
end
def process_params
if data_source[:association][:id].present?
2018-03-15 14:41:04 +01:00
params = data_source[:association].slice(*attr_to_fetch)
params[:rna] = data_source[:association][:id]
params.transform_keys { |k| :"association_#{k}" }
2018-03-15 14:41:04 +01:00
else
{}
2018-02-28 17:16:03 +01:00
end
2015-12-11 10:36:16 +01:00
end
def attr_to_fetch
[
:titre,
:objet,
:date_creation,
:date_declaration,
:date_publication
2015-12-11 10:36:16 +01:00
]
end
end