Module: Localeapp::Routes::Export

Included in:
Localeapp::Routes
Defined in:
lib/localeapp/routes/export.rb

Instance Method Summary collapse

Instance Method Details

#export_endpoint(options = {}) ⇒ Object



4
5
6
# File 'lib/localeapp/routes/export.rb', line 4

def export_endpoint(options = {})
  [:get, export_url(options)]
end

#export_url(options = {}) ⇒ Object



8
9
10
11
12
13
# File 'lib/localeapp/routes/export.rb', line 8

def export_url(options = {})
  options[:format] ||= 'yml'
  url = http_scheme.build(base_options.merge(:path => export_path(options[:format])))
  url.query = options[:query].map { |k,v| "#{k}=#{v}" }.join('&') if options[:query]
  url.to_s
end