Sha256: faa786e8dd4f7bcad73d05baeb1ef6d3ebc9db19183f684e00300d2a713d7c83

Contents?: true

Size: 558 Bytes

Versions: 16

Compression:

Stored size: 558 Bytes

Contents

module Localeapp
  module Routes
    module Remove
      def remove_endpoint(options = {})
        [:delete, remove_url(options)]
      end

      def remove_url(options = {})
        url = http_scheme.build(base_options.merge(:path => remove_path(options[:key], options[:format])))
        url.to_s
      end

    private

      def remove_path(key, format = nil)
        raise "remove_path requires a key" if key.nil?
        path = translations_path << "/#{escape_key(key)}"
        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/remove.rb
localeapp-3.2.0 lib/localeapp/routes/remove.rb
localeapp-3.1.3 lib/localeapp/routes/remove.rb
localeapp-3.1.2 lib/localeapp/routes/remove.rb
localeapp-3.1.1 lib/localeapp/routes/remove.rb
localeapp-3.1.0 lib/localeapp/routes/remove.rb
localeapp-3.0.1 lib/localeapp/routes/remove.rb
localeapp-3.0.0 lib/localeapp/routes/remove.rb
localeapp-2.5.0 lib/localeapp/routes/remove.rb
localeapp-2.4.0 lib/localeapp/routes/remove.rb
localeapp-2.3.0 lib/localeapp/routes/remove.rb
localeapp-2.2.0 lib/localeapp/routes/remove.rb
localeapp-2.1.1 lib/localeapp/routes/remove.rb
localeapp-2.1.0 lib/localeapp/routes/remove.rb
localeapp-2.0.0 lib/localeapp/routes/remove.rb
localeapp-1.0.2 lib/localeapp/routes/remove.rb