Sha256: 86eab7806fc010c155c306a6e8381c6662ceba7821f362783a06881df90a8b64

Contents?: true

Size: 548 Bytes

Versions: 14

Compression:

Stored size: 548 Bytes

Contents

# encoding: UTF-8

module Spontaneous
  module Extensions
    module Array
      def render_using(renderer, *args)
        self.map { |e|
          if e.respond_to?(:render_using)
            e.render_using(renderer, *args)
          elsif e.respond_to?(:render)
            e.render(*args)
          else
            e
          end
        }.join
      end

      def render(*args)
        self.map { |e| e.respond_to?(:render) ? e.render(*args) : e }.join
      end
    end
  end
end


class Array
  include Spontaneous::Extensions::Array
end


Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta9 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta8 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta7 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta6 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta5 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta4 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta3 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta2 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.beta1 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/extensions/array.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/extensions/array.rb