Class: Releaf::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/releaf/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config


3
4
5
# File 'lib/releaf/application.rb', line 3

def config
  @config
end

Instance Method Details

#configure(&block) ⇒ Object


5
6
7
8
9
10
# File 'lib/releaf/application.rb', line 5

def configure(&block)
  self.config = Releaf::Configuration.new
  instance_eval(&block)
  config.initialize_locales
  config.initialize_components
end

#render_layout(template) ⇒ Object


12
13
14
15
# File 'lib/releaf/application.rb', line 12

def render_layout(template)
  builder_class = config.layout_builder_class_name.constantize
  builder_class.new(template).output{ yield }.html_safe
end