Module: Weft::Page::Assets::ClassMethods
- Defined in:
- lib/weft/page/assets.rb
Overview
Class-level registration DSL. Each register_* call accumulates; the matching reader returns own + inherited entries in ancestor order.
Instance Method Summary collapse
-
#inline_css ⇒ Object
All registered inline CSS blocks (own + inherited).
-
#inline_js ⇒ Object
All registered inline JS blocks (own + inherited).
-
#register_inline_css(css) ⇒ Object
Register a block of inline CSS to include in the page head.
-
#register_inline_js(javascript) ⇒ Object
Register a block of inline JavaScript to include in the page head.
-
#register_script(src, assets: nil, **html_attrs) ⇒ Object
Register a script to include in the page head.
-
#register_stylesheet(href, assets: nil) ⇒ Object
Register a stylesheet to include in the page head.
-
#scripts ⇒ Object
All registered scripts (own + inherited).
-
#stylesheets ⇒ Object
All registered stylesheets (own + inherited).
Instance Method Details
#inline_css ⇒ Object
All registered inline CSS blocks (own + inherited).
96 97 98 99 100 101 102 |
# File 'lib/weft/page/assets.rb', line 96 def inline_css if superclass.respond_to?(:inline_css) superclass.inline_css + own_inline_css else own_inline_css.dup end end |
#inline_js ⇒ Object
All registered inline JS blocks (own + inherited).
105 106 107 108 109 110 111 |
# File 'lib/weft/page/assets.rb', line 105 def inline_js if superclass.respond_to?(:inline_js) superclass.inline_js + own_inline_js else own_inline_js.dup end end |
#register_inline_css(css) ⇒ Object
Register a block of inline CSS to include in the page head. Each registered string emits as its own