Method: RTKIT::ImageParent#update_image_position

Defined in:
lib/rtkit/mixins/image_parent.rb

#update_image_position(image, new_pos) ⇒ Object

Updates the position that is registered for the image for this series.

Raises:

  • (ArgumentError)


31
32
33
34
35
36
37
# File 'lib/rtkit/mixins/image_parent.rb', line 31

def update_image_position(image, new_pos)
  raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
  # Remove old position key:

  @image_positions.delete(image.pos_slice)
  # Add the new position:

  @image_positions[new_pos] = image
end