class
Sheen::Style::Builder
- Sheen::Style::Builder
- Reference
- Object
Overview
A mutable scratch object yielded by Sheen.style.
Forwards every setter to the wrapped immutable Style and accumulates the result, so block-style config reads imperatively while the Style stays immutable under the covers.
Defined in:
sheen/style.crConstructors
Macro Summary
-
method_missing(call)
Forward any setter call to the wrapped Style, storing the new Style.
Instance Method Summary
-
#style : Style
The accumulated Style so far.
-
#transform(&block : String -> String) : self
Style#transformcaptures its block as a proc, so it needs an explicit forwarder defined here in Builder.
Constructor Detail
Macro Detail
Instance Method Detail
def transform(&block : String -> String) : self
#
Style#transform captures its block as a proc, so it needs an explicit forwarder defined here in Builder.
Otherwise Builder#method_missing can't forward the block to Style#transform because it rewrites a forwarded block into yield, which is illegal inside a captured block.