Class: SilkLayout::Layout::Root

Inherits:
Object
  • Object
show all
Defined in:
lib/silk_layout/layout/root.rb

Class Method Summary collapse

Class Method Details

.find(box) ⇒ Object



6
7
8
9
10
11
# File 'lib/silk_layout/layout/root.rb', line 6

def self.find(box)
  return nil unless box
  return box unless box.node&.tag == "html"

  box.children.find { |child| child.node&.tag == "body" } || box
end