Module: Riml::NotNestedUnder

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

Instance Method Summary collapse

Instance Method Details

#non_nested?(klass = not_nested_under_class) ⇒ Boolean

Returns:

  • (Boolean)


147
148
149
150
151
152
153
# File 'lib/nodes.rb', line 147

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



156
157
158
# File 'lib/nodes.rb', line 156

def not_nested_under_class
  self.class
end