Class: Autochthon::Web
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Autochthon::Web
- Defined in:
- lib/autochthon/web.rb
Instance Method Summary collapse
Instance Method Details
#expand_translation(key, value) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/autochthon/web.rb', line 16 def (key, value) keys = key.split(I18n::Backend::Flatten::FLATTEN_SEPARATOR) keys[0...-1].reverse.inject(keys.last => value) do |out, k| {k => out} end end |
#json ⇒ Object
12 13 14 |
# File 'lib/autochthon/web.rb', line 12 def json @json ||= JSON.parse(request.body.read, symbolize_names: true) end |