Sha256: f5099fa133b6eb9b704a5f1e5a0df706cd4d114522e15ef7911ca42af3d4caa4

Contents?: true

Size: 622 Bytes

Versions: 10

Compression:

Stored size: 622 Bytes

Contents

module MetaTags
  # Represents an HTML meta tag with no content (<tag />).
  class Tag
    attr_reader :name, :attributes

    # Initializes a new instance of Tag class.
    #
    # @param [String, Symbol] name HTML tag name
    # @param [Hash] attributes list of HTML tag attributes
    #
    def initialize(name, attributes = {})
      @name = name
      @attributes = attributes
    end

    # Render tag into a Rails view.
    #
    # @param [ActionView::Base] view instance of a Rails view.
    # @return [String] HTML string for the tag.
    #
    def render(view)
      view.tag(name, attributes)
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
meta-tags-2.5.0 lib/meta_tags/tag.rb
meta-tags-2.4.1 lib/meta_tags/tag.rb
meta-tags-2.4.0 lib/meta_tags/tag.rb
meta-tags-2.3.1 lib/meta_tags/tag.rb
meta-tags-2.2.0 lib/meta_tags/tag.rb
meta_tags-rails-1.1.1 lib/meta_tags-rails/tag.rb
meta_tags-rails-1.1.0 lib/meta_tags-rails/tag.rb
meta_tags-rails-1.0.0 lib/meta_tags-rails/tag.rb
meta-tags-2.1.0 lib/meta_tags/tag.rb
meta-tags-2.0.0 lib/meta_tags/tag.rb