module Ruta
stores contexts
matches routes to a handeler
Constants
- VERSION
Attributes
config[R]
Public Class Methods
configure(&block)
click to toggle source
# File lib/ruta.rb, line 33 def configure &block if self.config @config.configure(&block) else @config = Config.new(&block) end end
get_url_for(context, reference, *params)
click to toggle source
used to retrieve a stored url
@param [Symbol] context of the stored url, if this is nil it defaults to the current context @param [Symbol] reference to the route @param [Array<String,Number,Boolean>] *params 0 or more params to replace params in the paramterized route @return [String] string containing url with any params given correctly inserted
# File lib/ruta.rb, line 46 def get_url_for context, reference, *params Router.route( context || Router.current_context, reference, params)[:path] end
start_app(&block)
click to toggle source
used to start the app @example start command placed inside of $document.ready block
$document.ready do Ruta.start_app end
# File lib/ruta.rb, line 65 def start_app &block if block_given? configure(&block) else configure unless self.config end Context.render(Router.current_context) Router.find_and_execute(History.current :path) History.listen_for_pop end