Sha256: 41359970b666aeeacb972a317cf046290cdb6559c60453e896a35d6299a0b866
Contents?: true
Size: 735 Bytes
Versions: 16
Compression:
Stored size: 735 Bytes
Contents
module Localeapp module Routes module Translations def translations_url(options={}) options[:format] ||= 'yml' url = http_scheme.build(base_options.merge(:path => translations_path(options[:format]))) url.query = options[:query].map { |k,v| "#{k}=#{v}" }.join('&') if options[:query] url.to_s end def translations_endpoint(options = {}) [:get, translations_url(options)] end def create_translation_endpoint(options = {}) [:post, translations_url(options)] end private def translations_path(format = nil) path = project_path << '/translations' path << ".#{format}" if format path end end end end
Version data entries
16 entries across 16 versions & 1 rubygems