Module: Riml::NotNestedUnder

Included in:
CatchNode, IfNode
Defined in:
lib/riml/nodes.rb

Instance Method Summary collapse

Instance Method Details

#non_nested?(klass = not_nested_under_class) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
64
65
66
67
# File 'lib/riml/nodes.rb', line 61

def non_nested?(klass = not_nested_under_class)
  n = self
  while (n = n.parent) != nil
    return false if n.is_a?(klass)
  end
  true
end

#not_nested_under_classObject

override if applicable



70
71
72
# File 'lib/riml/nodes.rb', line 70

def not_nested_under_class
  self.class
end