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

Override enum & enum-like value comparison #44

Open
byteit101 opened this issue Apr 20, 2013 · 2 comments
Open

Override enum & enum-like value comparison #44

byteit101 opened this issue Apr 20, 2013 · 2 comments

Comments

@byteit101
Copy link
Member

> jfxObject.enum_prop = :enum_value
> jfxObject.enum_prop == :enum_value
false
> jfxObject.enum_prop == EnumType::EnumValue
true

This is the current behavior pattern of enums. We need to override comparisons so that it meets expectations. This can probbably go with the enum injection code in dsl.rb. Annoys me the most often with KeyCodes

@enebo
Copy link
Member

enebo commented Apr 22, 2013

This is also a problem for all symbol-based values or at least we might also consider those to be a problem. Should:

button(fill: :gree)
#...
button.fill == :green

I know this is a specific issue only for enums but we might want to consider tackling all values or at least why enums make more sense to work than values themselves.

@byteit101
Copy link
Member Author

Yes, I meant everything that uses that style

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants