Sha256: 10add7b4c9e631249c637bb0790ec6e9cce14348260a70793d9bf6ee9668d0c9

Contents?: true

Size: 592 Bytes

Versions: 6

Compression:

Stored size: 592 Bytes

Contents

module Localeapp
  module Routes
    module Copy
      def copy_endpoint(options = {})
        [:post, copy_url(options)]
      end

      def copy_url(options = {})
        url = http_scheme.build(base_options.merge(:path => copy_path(options[:source_name], options[:format])))
        url.to_s
      end

    private

      def copy_path(source_name, format = nil)
        raise "copy_path requires source name" if source_name.nil?
        path = translations_path << "/#{escape_key(source_name)}" << "/copy"
        path << ".#{format}" if format
        path
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
localeapp-3.3.0 lib/localeapp/routes/copy.rb
localeapp-3.2.0 lib/localeapp/routes/copy.rb
localeapp-3.1.3 lib/localeapp/routes/copy.rb
localeapp-3.1.2 lib/localeapp/routes/copy.rb
localeapp-3.1.1 lib/localeapp/routes/copy.rb
localeapp-3.1.0 lib/localeapp/routes/copy.rb