Method: Skeem::SkmFrame#depth

Defined in:
lib/skeem/skm_frame.rb

#depthInteger

The number of parents this frame has.

Returns:

  • (Integer)

    The nesting levels



95
96
97
98
99
100
101
102
103
104
105
# File 'lib/skeem/skm_frame.rb', line 95

def depth
  count = 0

  curr_frame = self
  while curr_frame.parent
    count += 1
    curr_frame = curr_frame.parent
  end

  count
end