Refactor internals of app.rb

This commit is contained in:
Hakan Ensari 2012-11-21 13:18:24 +00:00
parent d723460b0a
commit 40cf0775d2

View File

@ -7,7 +7,7 @@ set :root, File.expand_path('..', File.dirname(__FILE__))
helpers do
def base
params[:base] || 'EUR'
params[:base] || Snapshot::DEFAULT_BASE
end
end
@ -22,9 +22,9 @@ get '/latest' do
.to_hash
end
get '/:date' do |date|
get '/:date' do
jsonp Snapshot
.new(date)
.new(params[:date])
.with_base(base)
.to_hash
end