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

Instance Method Details

#inline_cssObject

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_jsObject

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