Module: Shoes::URLDefiner

Defined in:
shoes-core/lib/shoes/url.rb

Instance Method Summary collapse

Instance Method Details

#url(page, method) ⇒ Object


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'shoes-core/lib/shoes/url.rb', line 24

def url(page, method)
  page = convert_page_to_regex(page)
  url_class = self

  Shoes::URL.urls[page] = proc do |app, arg|
    new_url_instance = url_class.new
    new_url_instance.app = app

    if arg
      new_url_instance.send(method, arg)
    else
      new_url_instance.send method
    end
  end
end