Closed AlexisKAndersen closed 7 years ago
Hello Alexis. Tell me about this PR? Also, I am about to make a release today or tomorrow. Did you get ChangeLog entries for all of the updates of the past few days?
Thanks for your help :)
I originally set out to not inherit Array, but mostly because I've heard it's bad. Functionally I just wanted methods like select to return a filtered down section collection instead of an array. There were a few other ways I looked into accomplishing it, but this seemed the cleanest. I was still hoping to put in just a tiny refactor on this. If you would like to see different here, I'm open to opinions.
Also, I will take some time tonight to write up changelog entries. I had meant to do it earlier this week, but got swamped with other work.
Why did you switch away from including Enumerable? That's typically the recommended approach. I think using it and implementing a custom #to_a
would address your concern.
@titusfortner, are you saying including enumerable, defining #each
and #to_a
will make the class return itself from methods like #select
? Because I'm not seeing that happening. Or are you saying do those in addition to custom implementing methods like #select
I'm saying that it appears you are bending over backward to re-implement what you get for free when you include Enumerable. The code history shows it used to be implemented that way, I'm curious why it was removed.
For instance, look at Watir::ElementCollection
#each
is implemented with #to_a
which is what locates the elements, figures out the relocatable selector for them and makes sure they are in the correct subtype.
I'm not as familiar with page sections or their collections to know what all goes into them, but I think the pattern should be similar.
@AlexisKAndersen I would like to get a PageObject release out today. Can I help you finish this PR?
I was going to look into the code the @titusfortner linked and see if I could gain any insight from it. If you want, you can roll without this PR. I'm free at ~6. I'll go on and put in my changelog entries then. Sorry for holding you up.
No apology necessary. I welcome your contributions.
On Aug 3, 2017, at 2:24 PM, Alexis Andersen notifications@github.com wrote:
I was going to look into the code the @titusfortner https://github.com/titusfortner linked and see if I could gain any insight from it. If you want, you can roll without this PR. I'm free at ~6. I'll go on and put in my changelog entries then. Sorry for holding you up.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cheezy/page-object/pull/433#issuecomment-320065968, or mute the thread https://github.com/notifications/unsubscribe-auth/AACGKkBhIdLSWukfNWuJGGtHndKq6pHcks5sUh5bgaJpZM4On6Ak.
@AlexisKAndersen I'm going to try to get a new release of the gem out late this week. Any chance of including this update?
Unfortunately, I'm very busy this week. I'll try and tie this up this weekend though.
To be honest, while the pull request could probably be merged in the state it's in, it's not providing a benefit that anyone is asking for right now, and I'm not particularly fond of the current solution. I'm closing for now, but we can revisit if anyone has a dying need for this in the future.
…l of methods instead of just arrays