Sha256: 4e1c6e46068f310ee86af7fe734f01065456910d348ab548a6d6ebe4a82ab0d5

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true
module Arbre
  module HTML

    class Document < Tag

      def build(*args)
        super
        build_head
        build_body
      end

      def document
        self
      end

      def tag_name
        'html'
      end

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

      def to_s
        doctype + super
      end

      protected

      def build_head
        @head = head do
          meta :"http-equiv" => "Content-type", content: "text/html; charset=utf-8"
        end
      end

      def build_body
        @body = body
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arbre-1.7.0 lib/arbre/html/document.rb
arbre-1.6.0 lib/arbre/html/document.rb
arbre-1.5.0 lib/arbre/html/document.rb