Class: Squared::Common::JoinSet

Inherits:
Set
  • Object
show all
Defined in:
lib/squared/common/class.rb

Instance Method Summary collapse

Constructor Details

#initialize(data = [], delim: ' ') ⇒ JoinSet

Returns a new instance of JoinSet.



6
7
8
9
# File 'lib/squared/common/class.rb', line 6

def initialize(data = [], delim: ' ')
  super(data.compact)
  @delim = delim
end

Instance Method Details

#doneObject



11
12
13
14
15
# File 'lib/squared/common/class.rb', line 11

def done
  ret = to_a.map!(&:to_s).reject(&:empty?).join(@delim)
  clear
  ret
end