-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruby: remove duplication in request methods, and make params uniform #136
Conversation
puts e.inspect | ||
end | ||
def malware_analyses(params={}) | ||
params = params.merge(access_token: @access_token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also toyed w/the idea of moving this line from each method into the HTTP methods -- thoughts?
@mgoffin got more where this came from, once this is merged 😎 |
Sounds good :) Although I don't maintain the Ruby stuff ;) |
aha! That's the key, then I conjure @maus- |
rescue => e | ||
puts e.inspect | ||
end | ||
params[:after] = cursor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this was in here before, but it is generally considered bad style to change the input parameters. Would be better if this copies stuff, e.g.
query_params = (params || {}).merge(:after : cursor)
@tomdz thx for looking this over! I've implemented your suggestions, and I also have another changeset after this PR that cleans up the code more. |
Awesome - the refactoring looks good. Glad to see this is getting some polish. I don't think this is a result of your changes but we still have some neglected functionality. IOC Submissions / Updates seem to be throwing 400 errors. I'll take a closer look shortly here. |
@maus- thx, I have a PR incoming for that next! (with updates to the example script, etc) |
Some ruby [client] refactoring:
get
,post
, anddelete
http methods to reusefilter
anddata
naming withparams
, to make it clear we're talking about HTTP request params