Method: Forma::Html.attr
- Defined in:
- lib/forma/html.rb
.attr(*params) ⇒ Object
Attribute creation.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/forma/html.rb', line 7 def attr(*params) if params.length == 2 SimpleAttr.new(params[0].to_s, params[1].to_s) elsif params.length == 1 and params[0].is_a?(Hash) StyleAttr.new(params[0]) elsif params.length == 1 ClassAttr.new(params[0]) else raise "illegal attr specification: #{params}" end end |