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
Adds accessor settings on instantiation via block or hash. #88
Conversation
Fixes .downcase being called on symbols. Cleaned up Cleans up hash setter. Adds block support Adds tests for hash and block instantiation Undoes string fix for patron/request.rb to keep with scope.
|
||
# Allows accessors to be set via constructor hash. Ex: {:base_url => 'www.home.com'} | ||
args.each do |attribute, value| | ||
self.send("#{attribute}=", value) |
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 know I suggested it, but you might not even need self
here. I might try it without it.
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.
Correct, sir. I just tested it. It doesn't need self
. Update incoming.
LGTM |
Adds accessor settings on instantiation via block or hash.
@cdcooksey @jschairb I have added both of you as collaborators on the repo. |
Thanks! If the need exists, I can update the README.md to show the new instantiation options. |
That sounds like a good idea. |
Changes
Allows
Patron::Session
to set accessors via constructor hash or block.Examples:
_via hash_
_via block_
New tests