Class Enumerable::Elementor
In: lib/more/facets/elementor.rb
Parent: Object

Elementor

Elementor is a type of Functor. Operations applied to it are routed to each element.

Methods

Public Class methods

[Source]

# File lib/more/facets/elementor.rb, line 101
  def initialize(elem_object, elem_method=nil)
    @elem_object = elem_object
    @elem_method = elem_method || :map
  end

Public Instance methods

[Source]

# File lib/more/facets/elementor.rb, line 106
  def instance_delegate
    @elem_object
  end

[Source]

# File lib/more/facets/elementor.rb, line 110
  def instance_operator
    @elem_method
  end

[Source]

# File lib/more/facets/elementor.rb, line 114
  def method_missing(sym,*args,&blk)
    @elem_object.__send__(@elem_method){ |x| x.__send__(sym,*args,&blk) }
  end

[Validate]