Class: Garterbelt::Page

Inherits:
View
  • Object
show all
Defined in:
lib/page.rb

Constant Summary

Constants inherited from View

View::CACHE_DETAIL_DEFAULT, View::CLOSED_TAGS, View::CONTENT_TAGS, View::HEAD_TAGS, View::MINIFIED_TAGS, View::NON_ESCAPE_TAGS

Class Attribute Summary collapse

Attributes inherited from View

#_buffer, #_curator, #_escape, #_level, #block, #cache_key_base, #cache_store_key, #initialization_options, #output, #render_style

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from View

accessories, add_accessor, #add_to_buffer, build_accessors, #cache, #cache_key, #cache_store, #call_block, #closed_tag, #comment_tag, #compact_tag, #curated?, default_variables, #doctype, #initialize, #javascript_link, #non_escape_tag, #page_title, #parse_tag_arguments, #partial, #raw_text, render, #render, #render_block, #render_buffer, requires, requires_only, #stylesheet_link, super_required, superclass?, #tag, #text, #to_html, #to_s, #xml

Constructor Details

This class inherits a constructor from Garterbelt::View

Class Attribute Details

.doctypeObject



13
14
15
# File 'lib/page.rb', line 13

def self.doctype
  @doctype ||= superclassed? ? superclass.doctype : :transitional
end

.html_attributesObject



17
18
19
# File 'lib/page.rb', line 17

def self.html_attributes
  @html_attributes ||= superclassed? ? superclass.html_attributes : {}
end

Class Method Details

.superclassed?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/page.rb', line 9

def self.superclassed?
  superclass.ancestors.include?(Garterbelt::Page)
end

Instance Method Details

#bodyObject



43
44
# File 'lib/page.rb', line 43

def body
end

#body_attributesObject

THE CONTENT —————————————————-



23
24
25
# File 'lib/page.rb', line 23

def body_attributes
  {}
end

#contentObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/page.rb', line 27

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

#headObject



40
41
# File 'lib/page.rb', line 40

def head
end