Class: Matestack::Ui::Core::Layout

Inherits:
Base
  • Object
show all
Defined in:
lib/matestack/ui/core/layout.rb

Constant Summary

Constants included from TagHelper

TagHelper::TAGS, TagHelper::VOID_TAGS

Instance Attribute Summary

Attributes inherited from Base

#bind_to_parent, #escape, #html_tag, #options, #parent, #text

Attributes included from Slots

#slots

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

call, #children, #create_children, #extract_options, #method_missing, #params, #prepare, #render?, #render_content, #to_str, #view_context

Methods included from TagHelper

#a, #detached, #detached_to_s, #heading, #img, #plain, #rails_render, #unescape

Methods included from Slots

#slot

Methods included from Properties

#context, #create_context, #create_context_for_properties, included, #optional_property_keys, #required_property_keys, #set_text

Constructor Details

#initialize(options = {}) ⇒ Layout

Returns a new instance of Layout.



6
7
8
9
10
# File 'lib/matestack/ui/core/layout.rb', line 6

def initialize(options = {})
  @controller = Context.controller
  Context.layout = self
  super(nil, nil, options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Matestack::Ui::Core::Base

Class Method Details

.inherited(subclass) ⇒ Object

layout class method to specify if a rails layout should be used



13
14
15
16
# File 'lib/matestack/ui/core/layout.rb', line 13

def self.inherited(subclass)
  subclass.layout(@layout)
  super
end

.layout(layout = nil) ⇒ Object



18
19
20
# File 'lib/matestack/ui/core/layout.rb', line 18

def self.layout(layout = nil)
  @layout = layout ? layout : @layout
end