lib/meteoservice/predict.rb in meteoservice-0.1.0 vs lib/meteoservice/predict.rb in meteoservice-0.2.0
- old
+ new
@@ -27,11 +27,12 @@
times_day = 'утром' if Range.new(*[6, 12].map(&:to_i)).include? @date[3]
times_day = 'днём' if Range.new(*[13, 17].map(&:to_i)).include? @date[3]
times_day = 'вечером' if Range.new(*[18, 23].map(&:to_i)).include? @date[3]
result = if today?
- "Сегодня в #{day_week} #{times_day}\n"
+ "Сегодня во #{day_week}, #{times_day}\n" if day_week == "вторник"
+ "Сегодня в #{day_week}, #{times_day}\n" unless day_week == "вторник"
else
"#{DateTime.new(@date[0], @date[1], @date[2], @date[3], 0, 0)
.strftime('%F')} в #{day_week} #{times_day}\n"
end
@@ -57,9 +58,9 @@
result << @temperature[1].to_s
result
end
def today?
- @date == Date.today
+ Date.today.strftime("%d") == @date[2].to_s
end
end
end