Class: JRuby::ScalaSupport::Seq::Mutable

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/jruby/scala_support.rb

Instance Method Summary collapse

Methods included from Common

#[], #each, #to_s

Instance Method Details

#[]=(index, value) ⇒ Object



283
284
285
286
287
288
289
290
291
292
# File 'lib/jruby/scala_support.rb', line 283

def []=(index, value)
  if index < 0
    @raw.update(size + index, value.to_scala)
  elsif index >= size
    (index - size + 1).times { @raw.send(:"+=", nil) }
    self[index] = value
  else
    @raw.update(index, value.to_scala)
  end
end