Module: HIR::Tags

Included in:
HIR
Defined in:
lib/hir.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_tag(tagname) ⇒ Object



12
13
14
15
# File 'lib/hir.rb', line 12

def self.add_tag(tagname)
  define_method(tagname)  { |*args, &block| tag(tagname, *args, &block) }
  define_method("#{tagname}!") { |*args, &block| tag_sc(tagname, *args) }
end

.add_tags(*tagnames) ⇒ Object



17
18
19
# File 'lib/hir.rb', line 17

def self.add_tags(*tagnames)
  tagnames.each { |tagname| add_tag(tagname) }
end

Instance Method Details

#comment(content) ⇒ Object



37
38
39
# File 'lib/hir.rb', line 37

def comment(content)
  handle_output "<!-- #{content} -->"
end

#doctype!Object



33
34
35
# File 'lib/hir.rb', line 33

def doctype!
  handle_output "<!DOCTYPE html>\n"
end

#none(content) ⇒ Object



41
42
43
# File 'lib/hir.rb', line 41

def none(content)
  handle_output content
end

#sir(styles) ⇒ Object



45
46
47
48
# File 'lib/hir.rb', line 45

def sir(styles)
  handle_output styles.map { |target, rules|
    "#{target}{#{rules.map { |rule| "#{rule[0]}:#{rule[1]}" }.join(";")}}" }.join
end