# File lib/innate/node.rb, line 665 def layout(layout_name = nil, &block) if layout_name and block # default name, but still check with block trait(:layout => lambda{|name, wish| layout_name.to_s if block.call(name, wish) }) elsif layout_name # name of a method or template trait(:layout => layout_name.to_s) elsif block # call block every request with name and wish, returned value is name # of layout template or method trait(:layout => block) else # remove layout for this node trait(:layout => nil) end return ancestral_trait[:layout] end