Project

enuminator

0.0
No release in over a year
Enuminator is a extension for gem enumerate_it
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 3.2.4
>= 3.1
 Project Readme

Enuminator is a EnumerateIt Extension

Enumerations for Ruby or Rails inspired in EnumerateIt with some magic powers! 🎩

Installation

gem install enuminator

Using with Rails

bundle add enuminator

Generators

You can use a Rails generator to create ApplicationEnumeration, because you need this main class to use enumerations:

bin/rails g enuminator:install

This command will create this file:

# /app/enumerations/application_controller.rb
class ApplicationEnumeration < Enuminator::Base
end

You can use a Rails generator to create a specific enumeration:

bin/rails g enuminator:enum relationship_status single married divorced

This command will create this file:

# /app/enumerations/application_controller.rb
class RelationshipStatus < ApplicationEnumeration
  associate_values(:single, :married, :divorced)
end

From now you could follow the EnumerateIt references =)

EnumerateIt References

Contributing

Bug reports and merge requests are welcome on GitHub at https://github.com/[USERNAME]/enuminator.