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

value: default to key #30

Merged
merged 4 commits into from
Jan 27, 2021
Merged

value: default to key #30

merged 4 commits into from
Jan 27, 2021

Conversation

gi
Copy link
Collaborator

@gi gi commented Jan 27, 2021

When defining a new enum, the value is optional. If not specified, the value
defaults to the key.

Fixes #28

class A
  include Ruby::Enum
  define :X
end

A::X == :X

When defining a new enum, the value is optional. If not specified, the value
defaults to the key.

Fixes #28
Copy link
Owner

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it very much, thanks!

  • document in README
  • update CHANGELOG

.rubocop_todo.yml Outdated Show resolved Hide resolved
gi added 2 commits January 27, 2021 09:53
The spec file violates the Metrics/BlockLength cop and always needs to be updated.
This excludes the file from being evaluated against that rule so that other blocks
may still adhere to a normal block length configuration.
Copy link
Owner

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits

CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@dblock dblock merged commit fcdbf36 into dblock:master Jan 27, 2021
@gi gi deleted the issue-28/default-value branch February 1, 2021 05:13
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

Successfully merging this pull request may close these issues.

Value: default to key
2 participants