Skip to content
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

Merged
merged 4 commits into from
Sep 3, 2013
Merged

map_headers refactored #528

merged 4 commits into from
Sep 3, 2013

Conversation

adbatista
Copy link
Contributor

I refactored map_headers

@adbatista adbatista mentioned this pull request Aug 31, 2013
@tooky
Copy link
Member

tooky commented Aug 31, 2013

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.

@adbatista
Copy link
Contributor Author

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 #map_headers

@adbatista
Copy link
Contributor Author

I added block to #map_headers and separated the specs of #map_headers and #map_headers!

table.map_headers!(mappings)
table
def map_headers(mappings={}, &block)
Table.new raw.dup, @conversion_procs.dup, mappings, block
Copy link
Member

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

@ghost ghost assigned os97673 Sep 3, 2013
os97673 added a commit that referenced this pull request Sep 3, 2013
@os97673 os97673 merged commit 3ca8609 into cucumber:v1.3.x-bugfix Sep 3, 2013
@tooky
Copy link
Member

tooky commented Sep 3, 2013

@adbatista thanks, appreciate your efforts on this.

@adbatista
Copy link
Contributor Author

Nice, my first Open source contribution.
Thank you too.

@adbatista adbatista deleted the refactor_map_headers branch September 6, 2013 18:53
@lock
Copy link

lock bot commented Oct 25, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants