Class: Arbo::HTML::Document

Inherits:
Tag show all
Defined in:
lib/arbo/html/document.rb

Constant Summary

Constants inherited from Tag

Tag::SELF_CLOSING_ELEMENTS

Instance Attribute Summary

Attributes inherited from Tag

#attributes

Attributes inherited from Element

#arbo_context, #children, #parent

Instance Method Summary collapse

Methods inherited from Tag

#add_class, #build, #class_list, #class_names, #extract_arguments, #get_attribute, #has_attribute?, #id, #id!, #id=, #initialize, #remove_attribute, #remove_class, #set_attribute

Methods inherited from Element

#+, #<<, #add_child, #ancestors, #assigns, #build, #children?, #content, #content=, #each, #find_first_ancestor, #get_elements_by_class_name, #get_elements_by_tag_name, #helpers, #html_safe, #indent_level, #initialize, #inspect, #parent?, #remove_child, #render_in_or_to_s, #to_ary, #to_str

Methods included from Element::BuilderMethods

#build_tag, #current_arbo_element, included, #insert_tag, #with_current_arbo_element

Constructor Details

This class inherits a constructor from Arbo::HTML::Tag

Instance Method Details

#doctypeObject



14
15
16
# File 'lib/arbo/html/document.rb', line 14

def doctype
  '<!DOCTYPE html>'.html_safe
end

#documentObject



6
7
8
# File 'lib/arbo/html/document.rb', line 6

def document
  self
end

#render_in(context = arbo_context) ⇒ Object



22
23
24
25
26
# File 'lib/arbo/html/document.rb', line 22

def render_in(context = arbo_context)
  context.output_buffer << doctype
  super
  context.output_buffer
end

#tag_nameObject



10
11
12
# File 'lib/arbo/html/document.rb', line 10

def tag_name
  'html'
end

#to_sObject



18
19
20
# File 'lib/arbo/html/document.rb', line 18

def to_s
  doctype + super
end