enumerated_type icon indicating copy to clipboard operation
enumerated_type copied to clipboard

Coercing a collection

Open BenEddy opened this issue 12 years ago • 2 comments

I find myself adding collection coercion frequently:

  def coerce(values)
    values.respond_to?(:map) ? values.map { |value| super(value) } : super(values)
  end

or

  def coerce(values)
    values.is_a?(Enumerable) ? values.map { |value| super(value) } : super(values)
  end

Bad idea to include this out-of-the-box?

BenEddy avatar Jul 11 '14 17:07 BenEddy

@BenEddy @rafer could we get some resolution here?

captain-enjoyable avatar Jul 25 '16 21:07 captain-enjoyable

Closed due to universal unpopularity.

BenEddy avatar Jul 25 '16 21:07 BenEddy