Module: Localeapp::Routes
Constant Summary collapse
- VERSION =
'v1'
Instance Method Summary collapse
- #create_translation_endpoint(options = {}) ⇒ Object
- #import_endpoint(options = {}) ⇒ Object
- #import_url(options = {}) ⇒ Object
- #missing_translations_endpoint(options = {}) ⇒ Object
- #missing_translations_url(options = {}) ⇒ Object
- #project_endpoint(options = {}) ⇒ Object
- #project_url(options = {}) ⇒ Object
- #translations_endpoint(options = {}) ⇒ Object
- #translations_url(options = {}) ⇒ Object
Instance Method Details
#create_translation_endpoint(options = {}) ⇒ Object
25 26 27 |
# File 'lib/localeapp/routes.rb', line 25 def create_translation_endpoint( = {}) [:post, translations_url()] end |
#import_endpoint(options = {}) ⇒ Object
40 41 42 |
# File 'lib/localeapp/routes.rb', line 40 def import_endpoint( = {}) [:post, import_url()] end |
#import_url(options = {}) ⇒ Object
44 45 46 |
# File 'lib/localeapp/routes.rb', line 44 def import_url(={}) http_scheme.build(.merge(:path => import_path)).to_s end |
#missing_translations_endpoint(options = {}) ⇒ Object
29 30 31 |
# File 'lib/localeapp/routes.rb', line 29 def missing_translations_endpoint( = {}) [:post, missing_translations_url()] end |
#missing_translations_url(options = {}) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/localeapp/routes.rb', line 33 def missing_translations_url(={}) [:format] ||= 'json' url = http_scheme.build(.merge(:path => missing_translations_path([:format]))) url.query = [:query].map { |k,v| "#{k}=#{v}" }.join('&') if [:query] url.to_s end |
#project_endpoint(options = {}) ⇒ Object
5 6 7 |
# File 'lib/localeapp/routes.rb', line 5 def project_endpoint( = {}) [:get, project_url()] end |
#project_url(options = {}) ⇒ Object
9 10 11 12 |
# File 'lib/localeapp/routes.rb', line 9 def project_url( = {}) [:format] ||= 'json' http_scheme.build(.merge(:path => project_path([:format]))).to_s end |
#translations_endpoint(options = {}) ⇒ Object
21 22 23 |
# File 'lib/localeapp/routes.rb', line 21 def translations_endpoint( = {}) [:get, translations_url()] end |
#translations_url(options = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/localeapp/routes.rb', line 14 def translations_url(={}) [:format] ||= 'json' url = http_scheme.build(.merge(:path => translations_path([:format]))) url.query = [:query].map { |k,v| "#{k}=#{v}" }.join('&') if [:query] url.to_s end |