Class: Squared::Common::JoinSet
- Inherits:
-
Set
- Object
- Set
- Squared::Common::JoinSet
- Defined in:
- lib/squared/common/class.rb
Instance Method Summary collapse
- #done ⇒ Object
-
#initialize(data = [], delim: ' ') ⇒ JoinSet
constructor
A new instance of JoinSet.
- #to_s ⇒ Object
Constructor Details
#initialize(data = [], delim: ' ') ⇒ JoinSet
Returns a new instance of JoinSet.
29 30 31 32 |
# File 'lib/squared/common/class.rb', line 29 def initialize(data = [], delim: ' ') super(data.compact) @delim = delim end |
Instance Method Details
#done ⇒ Object
34 35 36 37 38 |
# File 'lib/squared/common/class.rb', line 34 def done ret = to_s clear ret end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/squared/common/class.rb', line 40 def to_s to_a.map!(&:to_s).reject(&:empty?).join(@delim) end |