lib/html-native/collections.rb
# Maps the given block to each element of *enum*. The result of each iteration
# is added to an HTMLComponent::Builder instance, which is returned after the
# final iteration.
#
# If no block is given, an enumerator is returned instead.
Maps the given block to each element of *enum*. The result of each iteration
is added to an HTMLComponent::Builder instance, which is returned after the
final iteration.

If no block is given, an enumerator is returned instead.
Maps the given block to each element of * enum * . The result of each iteration is added to an HTMLComponent :: Builder instance which is returned after the final iteration . If no block is given an enumerator is returned instead .
def component_map 
    if block_given?
      result = HTMLComponent::Builder.new
      each do |e|
        result += yield(e)
      end
      result
    else
      to_enum(:component_map)
    end
  end
def component_map if block_given? result = HTMLComponent :: Builder . new each do | e | result += yield ( e ) end result else to_enum ( :component_map ) end end
Maps the given block to each element of *enum*.
Maps the given block to each element of * enum * .