Sha256: b823e5ee319698b72643d3063a0a983afc6a467bc7939b8374a91975910a33f5

Contents?: true

Size: 613 Bytes

Versions: 16

Compression:

Stored size: 613 Bytes

Contents

module Localeapp
  module Routes
    module Rename
      def rename_endpoint(options = {})
        [:post, rename_url(options)]
      end

      def rename_url(options = {})
        url = http_scheme.build(base_options.merge(:path => rename_path(options[:current_name], options[:format])))
        url.to_s
      end

    private

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