Class: Houston::Extensions::Layout
- Inherits:
-
Object
- Object
- Houston::Extensions::Layout
- Defined in:
- lib/houston/boot/extensions/layout.rb
Defined Under Namespace
Classes: ExtensionDsl, Extensions
Instance Attribute Summary collapse
-
#extensions_by_layout ⇒ Object
readonly
Returns the value of attribute extensions_by_layout.
Instance Method Summary collapse
- #[](layout) ⇒ Object
- #all ⇒ Object
-
#initialize ⇒ Layout
constructor
A new instance of Layout.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Layout
Returns a new instance of Layout.
6 7 8 |
# File 'lib/houston/boot/extensions/layout.rb', line 6 def initialize reset! end |
Instance Attribute Details
#extensions_by_layout ⇒ Object (readonly)
Returns the value of attribute extensions_by_layout.
4 5 6 |
# File 'lib/houston/boot/extensions/layout.rb', line 4 def extensions_by_layout @extensions_by_layout end |
Instance Method Details
#[](layout) ⇒ Object
16 17 18 19 |
# File 'lib/houston/boot/extensions/layout.rb', line 16 def [](layout) raise ArgumentError, "#{layout} is not a layout. Valid layouts are #{extensions_by_layout.keys.join(", ")}" unless extensions_by_layout.key?(layout) ExtensionDsl.new(extensions_by_layout, layout) end |
#all ⇒ Object
21 22 23 |
# File 'lib/houston/boot/extensions/layout.rb', line 21 def all ExtensionDsl.new(extensions_by_layout, *extensions_by_layout.keys) end |
#reset! ⇒ Object
10 11 12 13 14 |
# File 'lib/houston/boot/extensions/layout.rb', line 10 def reset! @extensions_by_layout = { "application" => Extensions.new, "dashboard" => Extensions.new } end |