fluke/devops-service/app/api3/routes/statistic.rb

21 lines
453 B
Ruby
Raw Permalink Normal View History

2018-04-04 22:44:39 +03:00
module Devops
module API3
module Routes
module StatisticRoutes
def self.registered(app)
app.define_policy :read_statistic, "Read statistic"
app.get_with_headers '/statistic' do
check_policy(:read_statistic)
json Devops::API3::Handler::Statistic.new(request).statistic().map(&:to_hash)
end
puts "Statistic routes initialized"
end
end
end
end
end