Class: EnumerableDecorator

Inherits:
Magic::Decorator::Base show all
Defined in:
lib/enumerable_decorator.rb

Instance Method Summary collapse

Methods inherited from Magic::Decorator::Base

#decorated?, name_for

Methods included from Magic::Decoratable

#decorate, #decorate!, #decorated, #decorated?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Magic::Decorator::Base

Instance Method Details

#to_aObject



4
# File 'lib/enumerable_decorator.rb', line 4

def to_a(...)   = super.map &:decorated

#to_aryObject



5
# File 'lib/enumerable_decorator.rb', line 5

def to_ary(...) = super.map &:decorated

#to_hObject



7
# File 'lib/enumerable_decorator.rb', line 7

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

#to_hashObject



8
# File 'lib/enumerable_decorator.rb', line 8

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