Sha256: 10839d9747602203227a1a101f9d26df1a351704bbec3b5a3696239bda873790

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

# encoding: utf-8

module Rango
  module Helpers
    # tag :a, href: "/contact" { anchor }
    # tag :a, "contact", href: "/contact"
    # @since 0.0.2
    def tag(tag, content, attrs = Hash.new, &block)
      attrs, content = content, String.new if attrs.empty? && content.is_a?(Hash)
      block.call if block
      %[<#{tag} #{attrs.to_html_attrs}>#{content}</#{tag}>]
    end

    # @since 0.0.2
    def single_tag(tag, attrs = Hash.new)
      %[<#{tag} #{attrs.to_html_attrs} />]
    end
  end
end

Rango.import("helpers/assets")
Rango.import("helpers/syntax")
Rango.import("helpers/general")
Rango.import("helpers/merb-helpers")

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rango-0.0.4 lib/rango/helpers.rb