Class: Transifex::ProjectComponents::LanguageComponents::Translators
- Inherits:
-
Object
- Object
- Transifex::ProjectComponents::LanguageComponents::Translators
- Includes:
- CrudRequests::Fetch, CrudRequests::Update
- Defined in:
- lib/transifex/project_components/language_components/translators.rb
Instance Attribute Summary collapse
-
#language_slug ⇒ Object
Returns the value of attribute language_slug.
-
#project_slug ⇒ Object
Returns the value of attribute project_slug.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(project_slug = nil, language_code = nil) ⇒ Translators
constructor
A new instance of Translators.
- #update(translators = {}, options = {}) ⇒ Object
Methods included from CrudRequests::Update
Methods included from CrudRequests::Fetch
Constructor Details
#initialize(project_slug = nil, language_code = nil) ⇒ Translators
Returns a new instance of Translators.
10 11 12 13 14 15 |
# File 'lib/transifex/project_components/language_components/translators.rb', line 10 def initialize(project_slug = nil, language_code = nil) raise MissingParametersError.new(["project_slug"]) if project_slug.nil? raise MissingParametersError.new(["language_code"]) if language_code.nil? @project_slug = project_slug @language_slug = language_code end |
Instance Attribute Details
#language_slug ⇒ Object
Returns the value of attribute language_slug.
8 9 10 |
# File 'lib/transifex/project_components/language_components/translators.rb', line 8 def language_slug @language_slug end |
#project_slug ⇒ Object
Returns the value of attribute project_slug.
8 9 10 |
# File 'lib/transifex/project_components/language_components/translators.rb', line 8 def project_slug @project_slug end |
Class Method Details
.authors ⇒ Object
17 18 19 |
# File 'lib/transifex/project_components/language_components/translators.rb', line 17 def self. [:project, :language] end |
Instance Method Details
#update(translators = {}, options = {}) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/transifex/project_components/language_components/translators.rb', line 21 def update(translators = {}, = {}) # Transifex needs coordinators list to be passed also when updating reviewers list. Strange # Fetch the current coordinators list and add it to the params as a workaround. coordinators = Transifex::Project.new(@project_slug).language(@language_slug).coordinators.fetch super(coordinators.merge({"translators" => translators}), ) end |