Top Level Namespace

Defined Under Namespace

Modules: Makanai

Instance Method Summary collapse

Instance Method Details

#redirect_to(url) ⇒ Object



13
14
15
16
17
18
# File 'lib/makanai/dsl.rb', line 13

def redirect_to(url)
  Makanai::Response.new.tap do |response|
    response.status = 302
    response.header = { 'Location' => url }
  end
end

#render(path) ⇒ Object



7
8
9
10
11
# File 'lib/makanai/dsl.rb', line 7

def render(path)
  template_root_path = Makanai::Settings.template_full_path
  full_path = File.join(template_root_path, "#{path}.erb")
  Makanai::Template.new(path: full_path).render
end

#routerObject



7
8
9
# File 'lib/makanai/main.rb', line 7

def router
  @router ||= Makanai::Router.new
end