Sha256: 5ddaa6fcc27df37c622d3aa3eee20ba03b934e546261fd525e59c1896594e786

Contents?: true

Size: 686 Bytes

Versions: 16

Compression:

Stored size: 686 Bytes

Contents

module Localeapp
  module Routes
    module MissingTranslations
      def missing_translations_endpoint(options = {})
        [:post, missing_translations_url(options)]
      end

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

    private

      def missing_translations_path(format = nil)
        path = project_path << '/translations/missing'
        path << ".#{format}" if format
        path
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
localeapp-3.3.0 lib/localeapp/routes/missing_translations.rb
localeapp-3.2.0 lib/localeapp/routes/missing_translations.rb
localeapp-3.1.3 lib/localeapp/routes/missing_translations.rb
localeapp-3.1.2 lib/localeapp/routes/missing_translations.rb
localeapp-3.1.1 lib/localeapp/routes/missing_translations.rb
localeapp-3.1.0 lib/localeapp/routes/missing_translations.rb
localeapp-3.0.1 lib/localeapp/routes/missing_translations.rb
localeapp-3.0.0 lib/localeapp/routes/missing_translations.rb
localeapp-2.5.0 lib/localeapp/routes/missing_translations.rb
localeapp-2.4.0 lib/localeapp/routes/missing_translations.rb
localeapp-2.3.0 lib/localeapp/routes/missing_translations.rb
localeapp-2.2.0 lib/localeapp/routes/missing_translations.rb
localeapp-2.1.1 lib/localeapp/routes/missing_translations.rb
localeapp-2.1.0 lib/localeapp/routes/missing_translations.rb
localeapp-2.0.0 lib/localeapp/routes/missing_translations.rb
localeapp-1.0.2 lib/localeapp/routes/missing_translations.rb