Sha256: 655d95ae408e2e60a202f16ed0d05a3d66fba95a47736b97e8e80ce61bd5a547
Contents?: true
Size: 672 Bytes
Versions: 3
Compression:
Stored size: 672 Bytes
Contents
# encoding: UTF-8 require 'sinatra/base' module Spontaneous::Rack class PageController < Sinatra::Base include Spontaneous::Rack::Public attr_reader :content, :page, :output def initialize(content, output) @content, @output = content, (output || :html).to_sym @page = content.page super(nil) end def render(*args) params = args.extract_options! output = @output page = @page args.each do |arg| case arg when Symbol output = arg when Spontaneous::Content page = arg end end _render_page_with_output(page, output, params) end end end
Version data entries
3 entries across 3 versions & 1 rubygems