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

Method name conflict with the icon `style` #8

Closed
namiwang opened this Issue Nov 25, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@namiwang

namiwang commented Nov 25, 2015

Yep there's an icon named style.

@Angelmmiguel Angelmmiguel added the bug label Nov 25, 2015

@Angelmmiguel Angelmmiguel self-assigned this Nov 25, 2015

@Angelmmiguel

This comment has been minimized.

Owner

Angelmmiguel commented Nov 25, 2015

I don't saw it 😨. I think three solutions to solve this problem:

  1. Update the name of style method. This option breaks retro compatibility with material_icon helper.
  2. Change the name of the icon in the gem. It can be confused, and I need to notify it in README.
  3. Create a new method called icon and don't use method_missing to get the name of the icon. This solution breaks retro compatibility, but with an icon method I prevent similar future problems.

I like the first and third solution; I will think it some time. Do you suggest another solution?

Thanks for report the issue!

@pikislabis

This comment has been minimized.

pikislabis commented Nov 25, 2015

If you want to still use method_missing, you can distinguish when you are trying to use style icon (no parameters) or style method (using parameters).

@Angelmmiguel Angelmmiguel added this to the v2.0.1 milestone Nov 25, 2015

@Angelmmiguel

This comment has been minimized.

Owner

Angelmmiguel commented Nov 25, 2015

Thanks, @pikislabis. I like your solution, and I will implement it in the gem.

However, I think I will create an icon method for a future release. In this case, style method receives parameters, but another cases like flip_vertical could be a problem.

Angelmmiguel pushed a commit that referenced this issue Jan 29, 2016

Angel M de Miguel
#8 Implemented the solution of @pikislabis. Now style method with no …
…params will set the icon to 'style'
@Angelmmiguel

This comment has been minimized.

Owner

Angelmmiguel commented Jan 29, 2016

Fixed in 2.0.1 version. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment