Sha256: 97dfc91657bc0d954fce44be119b637fecae07d9fe34001bb164c84cf5e7bcb3

Contents?: true

Size: 635 Bytes

Versions: 3

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

require "rango/helpers/assets"
require "rango/helpers/syntax"
require "rango/helpers/general"
require "rango/helpers/merb-helpers"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rango-0.1.0 lib/rango/helpers.rb
rango-0.0.6 lib/rango/helpers.rb
rango-0.1.pre lib/rango/helpers.rb