Repository navigation
Add method to get ratings - #2
Merged
Merged
Conversation
| rating = 0 | ||
| query = {mailboxes: mailbox_id, user: user_id, start: start_date, end: end_date, rating: rating} | ||
|
|
||
| get("reports/user/ratings", page, modified_since, query) |
Contributor
There was a problem hiding this comment.
This is still your old Scoutest syntax, you need to move them to an options hash.
I'd write the whole method like this.
Thoughts: name it like the end point, has all the required parameters as parameters in the method. Might want to cast the dates to the right format (ISO 8601, in UTC) if you want.
def reports_user_ratings(user_id, rating, start_date, end_date, options)
options = {
user: user_id,
rating: rating,
start: start_date,
end: end_date,
}
get("reports/user/ratings", options)You can use all the extra parameters (modified_since, user_id, etc) via the options Hash in Scoutest.
Contributor
Author
There was a problem hiding this comment.
Thoughts: name it like the end point
Hhm, that's not currently the case for every method FYI. But I'll do that.
[... the code ...]
Perfect, thanks. I'll just commit this, fine for me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pretty self-explanatory. Was using this in scoutest, now extracting out into the gem.
Small note: using
start_dateandend_dateas variables, notstartandendas they've defined them at Helpscout, because those make things break :D