Class: SmartlingApi::Project
- Inherits:
-
Object
- Object
- SmartlingApi::Project
- Defined in:
- lib/smartling_api/project.rb
Overview
Access to Smartling Project API
Instance Method Summary collapse
-
#initialize(smartling: smartling_client, token: access_token, project_id: current_project_id) ⇒ Project
constructor
A new instance of Project.
-
#list_locales ⇒ Array
Access to Smartling project api to retrieve list of locales available.
Constructor Details
#initialize(smartling: smartling_client, token: access_token, project_id: current_project_id) ⇒ Project
Returns a new instance of Project.
7 8 9 10 11 |
# File 'lib/smartling_api/project.rb', line 7 def initialize(smartling: smartling_client, token: access_token, project_id: current_project_id) @token = token @project_id = project_id @smartling = smartling end |
Instance Method Details
#list_locales ⇒ Array
Access to Smartling project api to retrieve list of locales available
21 22 23 |
# File 'lib/smartling_api/project.rb', line 21 def list_locales smartling.get(url: "/projects-api/v2/projects/#{project_id}", token: token).fetch("targetLocales", []) end |