module Navigator # Represents a HTML tag. class Tag attr_accessor :name, :content, :attributes # Initalizes the HTML tag. # ==== Parameters # * +name+ - Required. The tag name. # * +content+ - Optional. The tag content. Default: nil # * +attributes+ - Optional. The tag attributes. Default: {} def initialize name, content = nil, attributes = {} @name, @content, @attributes = name, content, attributes end # Answers the attributes as fully formed HTML attributes for the tag. def html_attributes @attributes.map {|key, value| "#{key}=\"#{value}\""}.compact * ' ' end # Answers the HTML tag prefix (i.e. the opening tag). Example: