Sha256: ee1efa7367eac9a525c3f701d93ca4727e21ddbc55b585aa47ff2e20315f7382

Contents?: true

Size: 923 Bytes

Versions: 10

Compression:

Stored size: 923 Bytes

Contents

module Garterbelt
  class Page < View
    # CLASS LEVEL CONFIGURATION --------------------------------------
    
    class << self
      attr_writer :doctype, :html_attributes
    end
    
    def self.superclassed?
      superclass.ancestors.include?(Garterbelt::Page)
    end
    
    def self.doctype
      @doctype ||= superclassed? ? superclass.doctype : :transitional
    end
    
    def self.html_attributes
      @html_attributes ||= superclassed? ? superclass.html_attributes : {}
    end
    
    # THE CONTENT ----------------------------------------------------
    
    def body_attributes
      {}
    end
    
    def content
      doctype self.class.doctype
      html( self.class.html_attributes ) do
        tag(:head) do
          head
        end
        
        tag(:body, body_attributes) do
          body
        end
      end
    end
    
    def head
    end
    
    def body
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
garterbelt-0.1.1 lib/page.rb
garterbelt-0.1.0 lib/page.rb
garterbelt-0.0.9 lib/page.rb
garterbelt-0.0.8 lib/page.rb
garterbelt-0.0.7 lib/page.rb
garterbelt-0.0.6 lib/page.rb
garterbelt-0.0.5 lib/page.rb
garterbelt-0.0.4 lib/page.rb
garterbelt-0.0.3 lib/page.rb
garterbelt-0.0.2 lib/page.rb