From 02a61dcd0900fe0da5c640e253ce06fc79baa6b8 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Sun, 28 Oct 2012 09:31:34 +1300 Subject: [PATCH] Added #join method as a shortcut for to_a.join --- ChangeLog | 4 ++++ lib/set.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 31cac1cb53a185..ee6e2e6eebea1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Oct 27 17:32:23 2012 Nathan Broadbent + + * lib/set.rb: Added #join method as a shortcut for to_a.join + Fri Oct 12 18:18:03 2012 Nobuyoshi Nakada * file.c (rb_get_path_check): path name must not contain NUL bytes. diff --git a/lib/set.rb b/lib/set.rb index 87a941e56511e1..f71727d5e153d9 100755 --- a/lib/set.rb +++ b/lib/set.rb @@ -152,6 +152,10 @@ def to_a @hash.keys end + def join(sep = nil) + to_a.join(sep) + end + def flatten_merge(set, seen = Set.new) # :nodoc: set.each { |e| if e.is_a?(Set)