Class: Wee::BlockComponent

Inherits:
Component show all
Defined in:
lib/wee/component.rb

Overview

class Component

Constant Summary

Constants inherited from Component

Component::NO_CHILDREN

Instance Method Summary collapse

Methods inherited from Component

#add_decoration, #children, #choose_from, #confirm, #decoration, #decoration=, depends, #each_decoration, #find_decoration, #inform, instanciate, #process_callbacks, #remove_decoration, #remove_decoration_if, #state

Methods inherited from Presenter

#process_callbacks, #render!, #renderer_class, #state

Constructor Details

#initialize(&block) ⇒ BlockComponent

Returns a new instance of BlockComponent.



354
355
356
# File 'lib/wee/component.rb', line 354

def initialize(&block)
  @block = block
end

Instance Method Details

#render(r) ⇒ Object



358
359
360
# File 'lib/wee/component.rb', line 358

def render(r)
  instance_exec(r, &@block)
end