data_source methods can be private
This commit is contained in:
parent
9a7e13f72f
commit
96f78b6213
4 changed files with 20 additions and 20 deletions
|
@ -4,12 +4,6 @@ class SIADE::EntrepriseAdapter
|
|||
@procedure_id = procedure_id
|
||||
end
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.entreprise(@siren, @procedure_id)
|
||||
rescue
|
||||
@data_source = nil
|
||||
end
|
||||
|
||||
def success?
|
||||
data_source
|
||||
rescue
|
||||
|
@ -26,6 +20,12 @@ class SIADE::EntrepriseAdapter
|
|||
|
||||
private
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.entreprise(@siren, @procedure_id)
|
||||
rescue
|
||||
@data_source = nil
|
||||
end
|
||||
|
||||
def attr_to_fetch
|
||||
[
|
||||
:siren,
|
||||
|
|
|
@ -4,10 +4,6 @@ class SIADE::EtablissementAdapter
|
|||
@procedure_id = procedure_id
|
||||
end
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.etablissement(@siret, @procedure_id)
|
||||
end
|
||||
|
||||
def success?
|
||||
data_source
|
||||
rescue
|
||||
|
@ -26,6 +22,10 @@ class SIADE::EtablissementAdapter
|
|||
|
||||
private
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.etablissement(@siret, @procedure_id)
|
||||
end
|
||||
|
||||
def attr_to_fetch
|
||||
[
|
||||
:adresse,
|
||||
|
|
|
@ -4,12 +4,6 @@ class SIADE::ExercicesAdapter
|
|||
@procedure_id = procedure_id
|
||||
end
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.exercices(@siret, @procedure_id)
|
||||
rescue
|
||||
@data_source = nil
|
||||
end
|
||||
|
||||
def to_params
|
||||
data_source[:exercices].map do |exercice|
|
||||
exercice.slice(*attr_to_fetch)
|
||||
|
@ -20,6 +14,12 @@ class SIADE::ExercicesAdapter
|
|||
|
||||
private
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.exercices(@siret, @procedure_id)
|
||||
rescue
|
||||
@data_source = nil
|
||||
end
|
||||
|
||||
def attr_to_fetch
|
||||
[:ca, :date_fin_exercice, :date_fin_exercice_timestamp]
|
||||
end
|
||||
|
|
|
@ -4,10 +4,6 @@ class SIADE::RNAAdapter
|
|||
@procedure_id = procedure_id
|
||||
end
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.rna(@siret, @procedure_id)
|
||||
end
|
||||
|
||||
def to_params
|
||||
if data_source[:association][:id].nil?
|
||||
return nil
|
||||
|
@ -21,6 +17,10 @@ class SIADE::RNAAdapter
|
|||
|
||||
private
|
||||
|
||||
def data_source
|
||||
@data_source ||= SIADE::API.rna(@siret, @procedure_id)
|
||||
end
|
||||
|
||||
def attr_to_fetch
|
||||
[
|
||||
:titre,
|
||||
|
|
Loading…
Reference in a new issue