Class: Component::Base

Inherits:
Object
  • Object
show all
Defined in:
app/components/component/base.rb

Direct Known Subclasses

CollectionTable, ResourceTable

Instance Method Summary collapse

Constructor Details

#initialize(view, options = {}, &block) ⇒ Base


3
4
5
6
7
8
# File 'app/components/component/base.rb', line 3

def initialize(view, options = {}, &block)
  @view        = view
  @block       = block
  @options     = options
  @view_locals = {}
end

Instance Method Details

#performObject


10
11
12
13
# File 'app/components/component/base.rb', line 10

def perform
  @block_output = block_output
  @view.render partial: self.class.name.underscore, locals: view_locals
end