Module: LocoRb::Api::Import
- Included in:
- Client
- Defined in:
- lib/loco-rb/api/import.rb
Constant Summary collapse
- PATH =
'import'
Instance Method Summary collapse
Instance Method Details
#import_locale(options = {ext: 'json'}) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/loco-rb/api/import.rb', line 6 def import_locale(={ext: 'json'}) opts = {} opts[:params] = { locale: [:locale] } if .dig( :locale) opts[:params] = opts[:params].merge({ "tag-updated": [:tag_updated] }) if .dig( :tag_updated) opts[:body] = IO.read([:path]) response = post("#{PATH}/#{[:ext] || 'json'}", opts) LocoRb::Resource::Import.new(response.data, response.headers, 'import') end |