Merge branch 'master' into iss-1192-test

This commit is contained in:
Raimond Garcia
2017-04-12 11:51:48 +02:00
committed by GitHub
406 changed files with 11980 additions and 1214 deletions

7
lib/age.rb Normal file
View File

@@ -0,0 +1,7 @@
module Age
def self.in_years(dob, now = Time.now.utc.to_date)
return nil unless dob.present?
# reference: http://stackoverflow.com/questions/819263/get-persons-age-in-ruby#comment21200772_819263
now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
end
end

View File

@@ -61,6 +61,10 @@ class CensusApi
end
end
def name
"#{data[:datos_habitante][:item][:nombre]} #{data[:datos_habitante][:item][:apellido1]}"
end
private
def data