From 9cc831bbc10873e8fc2e9384a5694f79d2b80082 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 11 Apr 2016 18:41:33 +0200 Subject: [PATCH] adds genre to the census api response --- lib/census_api.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/census_api.rb b/lib/census_api.rb index 737f7f873..9bcde62be 100644 --- a/lib/census_api.rb +++ b/lib/census_api.rb @@ -49,6 +49,10 @@ class CensusApi data[:datos_vivienda][:item][:codigo_distrito] end + def genre # "Varón" or "Mujer" + data[:datos_habitante][:item][:descripcion_sexo] + end + private def data @@ -86,7 +90,7 @@ class CensusApi end def stubbed_response_body - {:get_habita_datos_response=>{:get_habita_datos_return=>{:hay_errores=>false, :datos_habitante=>{:item=>{:fecha_nacimiento_string=>"31-12-1980", :identificador_documento=>"12345678Z", }}, :datos_vivienda=>{:item=>{:codigo_postal=>"28013", :codigo_distrito=>"01"}}}}} + {get_habita_datos_response: {get_habita_datos_return: {hay_errores: false, datos_habitante: { item: {fecha_nacimiento_string: "31-12-1980", identificador_documento: "12345678Z", description_sexo: "Varón" }}, datos_vivienda: {item: {codigo_postal: "28013", codigo_distrito: "01"}}}}} end def is_dni?(document_type)