Sha256: 5c3316d2b9d1e185adde040769a71cbbf58108cb2e160b3f427f937e320739d5

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

# encoding: UTF-8

module Spontaneous::Model::Core
  module Render
    extend Spontaneous::Concern

    def output(format = :html)
      return page.output(format, self) if page
      raise "Cannot render content without enclosing page"
    end

    def render(format = :html, params = {}, *args)
      params, format = format, :html if format.is_a?(Hash)
      output(format).render(params, *args)
    end

    def render_using(renderer, format = :html, params = {}, *args)
      output(format).render_using(renderer, params, *args)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta4 lib/spontaneous/model/core/render.rb
spontaneous-0.2.0.beta3 lib/spontaneous/model/core/render.rb
spontaneous-0.2.0.beta2 lib/spontaneous/model/core/render.rb
spontaneous-0.2.0.beta1 lib/spontaneous/model/core/render.rb