Class: Bemer::Component

Inherits:
Object
  • Object
show all
Defined in:
lib/bemer/component.rb

Instance Method Summary collapse

Constructor Details

#initialize(view) ⇒ Component

Returns a new instance of Component.



5
6
7
# File 'lib/bemer/component.rb', line 5

def initialize(view)
  @template_catalog = view.instance_variable_get(:@bemer_template_catalog)
end

Instance Method Details

#render(**options, &block) ⇒ Object



9
10
11
12
13
# File 'lib/bemer/component.rb', line 9

def render(**options, &block)
  return if !block_given? || template_catalog.nil?

  Tree.new(template_catalog, options).render(&block)
end