class Getto::Elm::Layout::Router::Container
Public Class Methods
new(path,app)
click to toggle source
# File lib/getto/elm/layout/router/container.rb, line 5 def initialize(path,app) @path = path @app = app @config = {} end
Public Instance Methods
namespace(path,config={},&block)
click to toggle source
# File lib/getto/elm/layout/router/container.rb, line 11 def namespace(path,config={},&block) @config.merge! Container.new(@path.dup.push(path),@app.deep_merge(config)).instance_exec(&block) end
page(page,title,config={})
click to toggle source
# File lib/getto/elm/layout/router/container.rb, line 14 def page(page,title,config={}) path = @path + [page] path_str = path.join("/") @config.merge!( path_str => @app.deep_merge(config).deep_merge( title: title, module: path.map{|p| "_#{p}".gsub(/_./){|k| k[1].upcase} }.join("."), path: path_str, ) ) end