class Pakyow::Presenter::Views::Layout
Attributes
name[RW]
Public Class Methods
load(path, content: nil, **args)
click to toggle source
# File lib/pakyow/presenter/views/layout.rb, line 10 def load(path, content: nil, **args) self.new(File.basename(path, ".*").to_sym, content || File.read(path), **args) end
new(name, html = "", **args)
click to toggle source
Calls superclass method
Pakyow::Presenter::View::new
# File lib/pakyow/presenter/views/layout.rb, line 15 def initialize(name, html = "", **args) @name = name super(html, **args) end
Public Instance Methods
build(page)
click to toggle source
# File lib/pakyow/presenter/views/layout.rb, line 24 def build(page) @object.each_significant_node(:container) do |container_node| container_node.replace(page.content(container_node.label(:container))) end View.from_object(@object).add_info(info, page.info) end
container(name = Views::Page::DEFAULT_CONTAINER)
click to toggle source
# File lib/pakyow/presenter/views/layout.rb, line 20 def container(name = Views::Page::DEFAULT_CONTAINER) @object.container(name.to_sym) end