Sha256: 27f5d84da6018adf5f24609152b4054ed46f5114774182f2228e0388b6761a2b

Contents?: true

Size: 609 Bytes

Versions: 5

Compression:

Stored size: 609 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

5 entries across 5 versions & 1 rubygems

Version Path
arbre-2.2.0 lib/arbre/html/document.rb
arbre-2.1.0 lib/arbre/html/document.rb
arbre-2.0.2 lib/arbre/html/document.rb
arbre-2.0.1 lib/arbre/html/document.rb
arbre-2.0.0 lib/arbre/html/document.rb