Class: TrackerApi::Endpoints::Review
- Defined in:
- lib/tracker_api/endpoints/review.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client) ⇒ Review
constructor
A new instance of Review.
- #update(review, params = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Review
Returns a new instance of Review.
6 7 8 |
# File 'lib/tracker_api/endpoints/review.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/tracker_api/endpoints/review.rb', line 4 def client @client end |
Instance Method Details
#update(review, params = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/tracker_api/endpoints/review.rb', line 10 def update(review, params = {}) raise ArgumentError, 'Valid review required to update.' unless review.instance_of?(Resources::Review) data = client.put("/projects/#{review.project_id}/stories/#{review.story_id}/reviews/#{review.id}", params: params).body review.attributes = data review.clean! review end |