class It::Tag

A generic class for html tags.

Attributes

options[R]
tag_name[R]

Public Class Methods

new(tag_name, options = {}) click to toggle source

See It.tag for details. You can do everything there and save 6 characters.

# File lib/it/tag.rb, line 9
def initialize(tag_name, options = {})
  raise TypeError, 'tag_name must be a String or Symbol' unless [String, Symbol].include?(tag_name.class)
  raise TypeError, 'options must be a Hash' unless options.is_a?(Hash)

  @tag_name = tag_name.to_sym
  @options = options.symbolize_keys
end