mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 02:52:49 +01:00
Refactor internals of app.rb
This commit is contained in:
parent
d723460b0a
commit
40cf0775d2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user