Module: Rack::App::FrontEnd::SingletonMethods

Defined in:
lib/rack/app/front_end/singleton_methods.rb

Instance Method Summary collapse

Instance Method Details

#helpers(&block) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rack/app/front_end/singleton_methods.rb', line 14

def helpers(&block)

  @helpers ||= lambda {
    helpers_module = Module.new
    helpers_module.__send__(:include, Rack::App::FrontEnd::Helpers)
    helpers_module.__send__(:extend, Rack::App::FrontEnd::SyntaxSugar::DSL)
  }.call

  @helpers.class_eval(&block) unless block.nil?

  return @helpers
end

#layout(layout_path = nil) ⇒ Object



9
10
11
12
# File 'lib/rack/app/front_end/singleton_methods.rb', line 9

def layout(layout_path=nil)
  @layout = Rack::App::Utils.expand_path(layout_path) unless layout_path.nil?
  @layout
end

#mount_folder(folder_path) ⇒ Object Also known as: mount_templates_from



3
4
5
# File 'lib/rack/app/front_end/singleton_methods.rb', line 3

def mount_folder(folder_path)
  Rack::App::FrontEnd::FolderMounter.new(self).mount(Rack::App::Utils.expand_path(folder_path))
end