Class: Transifex::ProjectComponents::LanguageComponents::Reviewers
- Inherits:
-
Object
- Object
- Transifex::ProjectComponents::LanguageComponents::Reviewers
- Includes:
- CrudRequests::Fetch, CrudRequests::Update
- Defined in:
- lib/tx-ruby/project_components/language_components/reviewers.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) ⇒ Reviewers
constructor
A new instance of Reviewers.
- #update(reviewers_list = {}, options = {}) ⇒ Object
Methods included from CrudRequests::Update
Methods included from CrudRequests::Fetch
Constructor Details
#initialize(project_slug = nil, language_code = nil) ⇒ Reviewers
Returns a new instance of Reviewers.
10 11 12 13 14 15 |
# File 'lib/tx-ruby/project_components/language_components/reviewers.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/tx-ruby/project_components/language_components/reviewers.rb', line 8 def language_slug @language_slug end |
#project_slug ⇒ Object
Returns the value of attribute project_slug.
8 9 10 |
# File 'lib/tx-ruby/project_components/language_components/reviewers.rb', line 8 def project_slug @project_slug end |
Class Method Details
.parents ⇒ Object
17 18 19 |
# File 'lib/tx-ruby/project_components/language_components/reviewers.rb', line 17 def self.parents [:project, :language] end |
Instance Method Details
#update(reviewers_list = {}, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/tx-ruby/project_components/language_components/reviewers.rb', line 21 def update(reviewers_list = {}, = {}) # 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. fetched_language_infos = Transifex::Project.new(@project_slug).language(@language_slug).fetch params = {} params[:coordinators] = fetched_language_infos["coordinators"] params[:reviewers] = reviewers_list super(params, ) end |