Class: RichERB::Panel

Inherits:
CustomTag show all
Defined in:
lib/richerb/panel.rb

Instance Attribute Summary

Attributes inherited from CustomTag

#arity, #context, #doc, #parent

Instance Method Summary collapse

Methods inherited from CustomTag

#insert, #method_missing

Constructor Details

#initialize(options = {}, root = nil, &block) ⇒ Panel

Returns a new instance of Panel.



3
4
5
6
7
8
9
10
# File 'lib/richerb/panel.rb', line 3

def initialize options = {}, root = nil, &block
  @header = options[:header]
  panel_options = {:class_ => 'rf-p'}
  super panel_options, 'div', root do |panel|
    panel.div({:class_ => 'rf-p-hdr'}, @header) unless @header.nil?
    yield self if block_given?
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RichERB::CustomTag