Class: Wizport::Html::Text

Inherits:
Element
  • Object
show all
Defined in:
lib/wizport/document/html/text.rb

Instance Method Summary collapse

Methods inherited from Element

#tag

Constructor Details

#initialize(html, txt, options = {}) ⇒ Text

options = {color:red, ‘font-size’:24, ‘text-align’ = left }



10
11
12
13
# File 'lib/wizport/document/html/text.rb', line 10

def initialize(html,txt,options = {})
  super html
  tag 'p', txt, {:style => options.collect {|k, v| "#{k}:#{v}"}.join(';')}.delete_if {|k,v| v == nil || v == ''}
end