Class: Roadie::Inliner Private
- Inherits:
-
Object
- Object
- Roadie::Inliner
- Defined in:
- lib/roadie/inliner.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The Inliner inlines stylesheets to the elements of the DOM.
Inlining means that StyleBlocks and a DOM tree are combined:
a { color: red; } # StyleBlock
<a href="/"></a> # DOM
becomes
<a href="/" style="color:red"></a>
Defined Under Namespace
Classes: StyleMap
Instance Method Summary collapse
-
#initialize(stylesheets) ⇒ Inliner
constructor
private
A new instance of Inliner.
-
#inline(dom) ⇒ nil
private
Start the inlining, mutating the DOM tree.
Constructor Details
#initialize(stylesheets) ⇒ Inliner
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Inliner.
19 20 21 |
# File 'lib/roadie/inliner.rb', line 19 def initialize(stylesheets) @stylesheets = stylesheets end |
Instance Method Details
#inline(dom) ⇒ nil
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Start the inlining, mutating the DOM tree.
27 28 29 30 |
# File 'lib/roadie/inliner.rb', line 27 def inline(dom) apply style_map(dom) nil end |