Sha256: b1706cd898d080197a0ae021f3d4dbf3ed2a7dd957215bb89ca7aeb58203f90e

Contents?: true

Size: 398 Bytes

Versions: 27

Compression:

Stored size: 398 Bytes

Contents

class WatchCollector
	
	def call(env)
		
		post_data = begin Yajl::Parser.new(:symbolize_keys => true).parse(env["rack.input"].read) || {} rescue {} end
		post_data[:received_at] = Time.now.to_s
		
		Collector.process(post_data)
		
		[200,{"Content-Type" => "text/plain"},["Got it!"]]
	end
	
	Routes.add_route new, { :request_method => 'POST', :path_info => %r{^/receive} }, {}, :receive_data
	
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
city-watch-0.7.9 lib/city_watch/collector/receive.rb
city-watch-0.7.8 lib/city_watch/collector/receive.rb
city-watch-0.7.7 lib/city_watch/collector/receive.rb
city-watch-0.7.6 lib/city_watch/collector/receive.rb
city-watch-0.7.5 lib/city_watch/collector/receive.rb
city-watch-0.7.4 lib/city_watch/collector/receive.rb
city-watch-0.7.3 lib/city_watch/collector/receive.rb
city-watch-0.7.2 lib/city_watch/collector/receive.rb
city-watch-0.7.1 lib/city_watch/collector/receive.rb
city-watch-0.7.0 lib/city_watch/collector/receive.rb
city-watch-0.6.9 lib/city_watch/collector/receive.rb
city-watch-0.6.8 lib/city_watch/collector/receive.rb
city-watch-0.6.7 lib/city_watch/collector/receive.rb
city-watch-0.6.6 lib/city_watch/collector/receive.rb
city-watch-0.6.5 lib/city_watch/collector/receive.rb
city-watch-0.6.4 lib/city_watch/collector/receive.rb
city-watch-0.6.3 lib/city_watch/collector/receive.rb
city-watch-0.6.2 lib/city_watch/collector/receive.rb
city-watch-0.6.1 lib/city_watch/collector/receive.rb
city-watch-0.6.0 lib/city_watch/collector/receive.rb