Completed
Push — master ( f48217...560331 )
by Yoh
01:11
created

ShortHand.pp()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
module Hyalite
2
  module Component
3
    module ShortHand
4
      TAGS = %w(
5
        a abbr address area article aside audio b base bdi bdo blockquote body br button button button button canvas caption
6
        cite code col colgroup command datalist dd del details dfn div dl dt em embed fieldset figcaption figure footer form
7
        h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link map mark menu meta
8
        meter nav noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small
9
        source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr
10
      )
11
12
      def self.included(klass)
13
        TAGS.each do |tag|
14
          define_method(tag) do |props, *children|
15
            Hyalite.create_element(tag, props, *children)
16
          end
17
        end
18
19
        klass.extend ClassMethods
20
      end
21
22
      module ClassMethods
23
        def el(props, *children)
24
          Hyalite.create_element(self, props, *children)
25
        end
26
      end
27
28
      def pp(obj)
29
        puts obj.inspect
30
      end
31
    end
32
  end
33
end
34