lib/centaman/attribute.rb in centaman-5.0.1 vs lib/centaman/attribute.rb in centaman-5.0.2
- old
+ new
@@ -37,11 +37,11 @@
def centaman_description
value
end
- def display_time
+ def display_time
array = value.split(":")
hour = array[0].try(:to_i)
minute = array[1].try(:to_i)
period = hour >= 12 ? 'pm' : 'am'
hour = hour > 12 ? hour - 12 : hour
@@ -49,12 +49,13 @@
"#{hour}:#{minute}#{period}"
# return [array.first, array[1]].join(":")
end
def age_group
- return 'adult' if value.downcase.include?("adult")
- return 'child' if value.downcase.include?("child")
- return 'youth' if value.downcase.include?("youth")
+ return 'adult' if value.downcase.include?('adult')
+ return 'child' if value.downcase.include?('child')
+ return 'youth' if value.downcase.include?('youth')
+ return 'senior' if value.downcase.include?('senior')
return 'adult'
end
def display_age_group
age_group.capitalize