Module: JRuby::ScalaSupport::Set::Common
Instance Method Summary collapse
Instance Method Details
#+(o) ⇒ Object
300 301 302 |
# File 'lib/jruby/scala_support.rb', line 300 def +(o) (@raw + o).from_scala end |
#-(o) ⇒ Object
304 305 306 |
# File 'lib/jruby/scala_support.rb', line 304 def -(o) (@raw - o).from_scala end |
#each ⇒ Object
308 309 310 311 312 313 314 315 316 |
# File 'lib/jruby/scala_support.rb', line 308 def each if block_given? @raw.foreach { |item| yield item.from_scala } else Enumerator.new do |yielder| each { |item| yielder << item } end end end |
#to_s ⇒ Object
318 319 320 321 322 323 324 |
# File 'lib/jruby/scala_support.rb', line 318 def to_s first = true each_with_object("#<Set: {") do |item, str| first ? first = false : str << ", " str << item.to_s end << "}>" end |