protected Method

Set.flatten_merge(set, seen = Set.new)

There's no documentation for this item.

Source Code

# File set.rb, line 117
def flatten_merge(set, seen = Set.new)
  set.each { |e|
    if e.is_a?(Set)
      if seen.include?(e_id = e.object_id)
        raise ArgumentError, "tried to flatten recursive Set"
      end

      seen.add(e_id)
      flatten_merge(e, seen)
      seen.delete(e_id)
    else
      add(e)
    end
  }

  self
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.