Sha256: 8769aa85f3495af61c3921b4dcef8671720b27853fafeea0e0f9aa17b307ea3b

Contents?: true

Size: 287 Bytes

Versions: 3

Compression:

Stored size: 287 Bytes

Contents

# frozen_string_literal: true

class EnumerableDecorator < Magic::Decorator::Base
	def to_a(...)   = super.map &:decorated
	def to_ary(...) = super.map &:decorated

	def to_h(...)    = super.to_h { |*h| h.map! &:decorated }
	def to_hash(...) = super.to_h { |*h| h.map! &:decorated }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
magic-decorator-1.0.0 lib/enumerable_decorator.rb
magic-decorator-0.3.0 lib/enumerable_decorator.rb
magic-decorator-0.2.0 lib/enumerable_decorator.rb