diff --git a/lib/vmpooler/api/v1.rb b/lib/vmpooler/api/v1.rb index f47ed9c..3bb91cd 100644 --- a/lib/vmpooler/api/v1.rb +++ b/lib/vmpooler/api/v1.rb @@ -13,14 +13,14 @@ module Vmpooler hostname end - def validate_date_str(date_str) - /^\d{4}-\d{2}-\d{2}$/ === date_str - end - def mean(list) s = list.map(&:to_f).reduce(:+).to_f (s > 0 && list.length > 0) ? s / list.length.to_f : 0 end + + def validate_date_str(date_str) + /^\d{4}-\d{2}-\d{2}$/ === date_str + end end get "#{api_prefix}/status/?" do