Class: Super::Layout
- Inherits:
-
Object
- Object
- Super::Layout
- Includes:
- Partial::Resolving
- Defined in:
- lib/super/layout.rb
Instance Attribute Summary collapse
-
#asides ⇒ Object
readonly
Returns the value of attribute asides.
-
#footers ⇒ Object
readonly
Returns the value of attribute footers.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#mains ⇒ Object
readonly
Returns the value of attribute mains.
Instance Method Summary collapse
-
#initialize(headers: nil, asides: nil, mains: nil, footers: nil) ⇒ Layout
constructor
A new instance of Layout.
- #resolve(template) ⇒ Object
- #resolved_asides ⇒ Object
- #resolved_footers ⇒ Object
- #resolved_headers ⇒ Object
- #resolved_mains ⇒ Object
- #to_partial_path ⇒ Object
Methods included from Partial::Resolving
Constructor Details
#initialize(headers: nil, asides: nil, mains: nil, footers: nil) ⇒ Layout
Returns a new instance of Layout.
9 10 11 12 13 14 |
# File 'lib/super/layout.rb', line 9 def initialize(headers: nil, asides: nil, mains: nil, footers: nil) @headers = Array(headers).compact @asides = Array(asides).compact @mains = Array(mains).compact @footers = Array().compact end |
Instance Attribute Details
#asides ⇒ Object (readonly)
Returns the value of attribute asides.
17 18 19 |
# File 'lib/super/layout.rb', line 17 def asides @asides end |
#footers ⇒ Object (readonly)
Returns the value of attribute footers.
19 20 21 |
# File 'lib/super/layout.rb', line 19 def @footers end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
16 17 18 |
# File 'lib/super/layout.rb', line 16 def headers @headers end |
#mains ⇒ Object (readonly)
Returns the value of attribute mains.
18 19 20 |
# File 'lib/super/layout.rb', line 18 def mains @mains end |
Instance Method Details
#resolve(template) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/super/layout.rb', line 25 def resolve(template) @resolved_headers = resolve_for_rendering(template, headers, nil) @resolved_asides = resolve_for_rendering(template, asides, nil) @resolved_mains = resolve_for_rendering(template, mains, nil) @resolved_footers = resolve_for_rendering(template, , nil) self end |
#resolved_asides ⇒ Object
37 38 39 |
# File 'lib/super/layout.rb', line 37 def resolved_asides @resolved_asides || [] end |
#resolved_footers ⇒ Object
45 46 47 |
# File 'lib/super/layout.rb', line 45 def @resolved_footers || [] end |
#resolved_headers ⇒ Object
33 34 35 |
# File 'lib/super/layout.rb', line 33 def resolved_headers @resolved_headers || [] end |
#resolved_mains ⇒ Object
41 42 43 |
# File 'lib/super/layout.rb', line 41 def resolved_mains @resolved_mains || [] end |
#to_partial_path ⇒ Object
21 22 23 |
# File 'lib/super/layout.rb', line 21 def to_partial_path "layout" end |