Class: Wee::PageDecoration
- Inherits:
-
WrapperDecoration
- Object
- Presenter
- Decoration
- WrapperDecoration
- Wee::PageDecoration
- Defined in:
- lib/wee/decoration.rb
Overview
class FormDecoration
Instance Attribute Summary
Attributes inherited from Decoration
Instance Method Summary collapse
- #global? ⇒ Boolean
-
#initialize(title = '', stylesheets = [], javascripts = []) ⇒ PageDecoration
constructor
A new instance of PageDecoration.
- #render(r) ⇒ Object
Methods inherited from WrapperDecoration
Methods inherited from Decoration
#process_callbacks, #render!, #render_presenter!, #state
Methods inherited from Presenter
#process_callbacks, #render!, #renderer_class, #state
Constructor Details
#initialize(title = '', stylesheets = [], javascripts = []) ⇒ PageDecoration
Returns a new instance of PageDecoration.
229 230 231 232 233 234 |
# File 'lib/wee/decoration.rb', line 229 def initialize(title='', stylesheets=[], javascripts=[]) @title = title @stylesheets = stylesheets @javascripts = javascripts super() end |
Instance Method Details
#global? ⇒ Boolean
236 |
# File 'lib/wee/decoration.rb', line 236 def global?() true end |
#render(r) ⇒ Object
238 239 240 241 242 243 244 245 246 247 |
# File 'lib/wee/decoration.rb', line 238 def render(r) r.page.title(@title).head { @stylesheets.each {|s| r.link_css(s) } @javascripts.each {|j| r.javascript.src(j) } r.style.type('text/css').with { r.define_divert(:styles) } r.javascript.with { r.define_divert(:javascripts) } }.with { render_inner(r) } end |