-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
map_headers refactored #528
map_headers refactored #528
Conversation
Looks good, thanks @adbatista. Do you think we should support the same api as #map_headers! and allow the user to pass a block as the new header_conversion_proc? That can also be passed to the constructor. |
I was thinking about that, and since map_headers! will be deprecated, I think it's a good idea allow the user pass a block to |
I added block to |
table.map_headers!(mappings) | ||
table | ||
def map_headers(mappings={}, &block) | ||
Table.new raw.dup, @conversion_procs.dup, mappings, block |
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.
@adbatista I think it would be safest if this called self.class.new
just in case someone is subclassing AST::Table
@adbatista thanks, appreciate your efforts on this. |
Nice, my first Open source contribution. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I refactored
map_headers