Class: Pakyow::Presenter::SignificantNode Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pakyow/presenter/significant_nodes.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.binding_within?(node) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


49
50
51
52
53
# File 'lib/pakyow/presenter/significant_nodes.rb', line 49

def self.binding_within?(node)
  node.children.any? { |child|
    BindingNode.significant?(child) || binding_within?(child)
  }
end

.within_binding?(node) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


39
40
41
42
43
44
45
46
47
# File 'lib/pakyow/presenter/significant_nodes.rb', line 39

def self.within_binding?(node)
  if BindingNode.significant?(node)
    true
  elsif !node.is_a?(Oga::XML::Document)
    within_binding?(node.parent)
  else
    false
  end
end

.within_form?(node) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
63
# File 'lib/pakyow/presenter/significant_nodes.rb', line 55

def self.within_form?(node)
  if FormNode.significant?(node)
    true
  elsif !node.is_a?(Oga::XML::Document)
    within_form?(node.parent)
  else
    false
  end
end