Class: Wunderbar::Overridable

Inherits:
BuilderBase show all
Defined in:
lib/wunderbar/html-methods.rb

Overview

factored out so that these methods can be overriden (e.g., by opal.rb)

Direct Known Subclasses

HtmlMarkup

Instance Method Summary collapse

Methods inherited from BuilderBase

#get_binding, #set_variables_from_params

Instance Method Details

#_script(*args, &block) ⇒ Object



5
6
7
8
9
# File 'lib/wunderbar/html-methods.rb', line 5

def _script(*args, &block)
  args << {} unless Hash === args.last
  args.last[:lang] ||= 'text/javascript'
  proxiable_tag! 'script', ScriptNode, *args, &block
end

#_style(*args, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wunderbar/html-methods.rb', line 11

def _style(*args, &block)
  if args == [:system]
    args[0] = %{
      pre._stdin {font-weight: bold; color: #800080; margin: 1em 0 0 0}
      pre._stdout {font-weight: bold; color: #000; margin: 0}
      pre._stderr {font-weight: bold; color: #F00; margin: 0}
    }
  end
  args << {} unless Hash === args.last
  args.last[:type] ||= 'text/css'
  proxiable_tag! 'style', StyleNode, *args, &block
end