class Enumbler::Collection
Not sure if this will be needed but was leaning toward a custom wrapper for our array holding the `enumbles` for our model. As it is, allows you to query them based on the enum:
“` Color.enumbles.black # => [Enumbler::Enumble] “`
Public Instance Methods
method_missing(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/enumbler/collection.rb, line 12 def method_missing(method_name, *args, &block) enumble = find { |e| e.enum == method_name } return enumble if enumble.present? super end
respond_to_missing?(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/enumbler/collection.rb, line 19 def respond_to_missing?(method_name, *args, &block) enumble = find { |e| e.enum == method_name } enumble.present? || super end