Class: Arbre::HTML::Document

Inherits:
Tag show all
Defined in:
lib/arbre/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

#arbre_context, #children, #parent

Instance Method Summary collapse

Methods inherited from Tag

#add_class, #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, #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, #to_ary, #to_str

Methods included from Element::BuilderMethods

#build_tag, #current_arbre_element, included, #insert_tag, #with_current_arbre_element

Constructor Details

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Arbre::Element

Instance Method Details

#build(*args) ⇒ Object


6
7
8
9
10
# File 'lib/arbre/html/document.rb', line 6

def build(*args)
  super
  build_head
  build_body
end

#doctypeObject


20
21
22
# File 'lib/arbre/html/document.rb', line 20

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

#documentObject


12
13
14
# File 'lib/arbre/html/document.rb', line 12

def document
  self
end

#tag_nameObject


16
17
18
# File 'lib/arbre/html/document.rb', line 16

def tag_name
  'html'
end

#to_sObject


24
25
26
# File 'lib/arbre/html/document.rb', line 24

def to_s
  doctype + super
end