Class: Fastlane::Helper::PoeditorExportHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/poeditor_export/helper/poeditor_export_helper.rb

Constant Summary collapse

API_URL =
'https://poeditor.com/api/'
EXPORT_ACTION =
'export'

Class Method Summary collapse

Class Method Details

.export_for_lanaguage(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/plugin/poeditor_export/helper/poeditor_export_helper.rb', line 7

def self.export_for_lanaguage(params)
  uri = URI(API_URL)

  export_params = {
    api_token: params[:api_token],
    action: EXPORT_ACTION,
    id: params[:project_id],
    type: params[:export_format],
    language: params[:language]
  }

  res = Net::HTTP.post_form(uri, export_params)
  json = JSON.parse(res.body)
  URI(json["item"])
end