Module: Inlay::Summary

Defined in:
lib/inlay/summary.rb

Class Method Summary collapse

Class Method Details

.call(object, normalized) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/inlay/summary.rb', line 7

def call(object, normalized)
  image = normalized.image || (normalized.frames&.first if normalized.frames)
  dimensions = image ? " #{image.width}x#{image.height}" : ""
  name = case object
  when Tessel::Image then "Tessel::Image"
  else object.class.name || object.class.to_s
  end
  frames = normalized.frames ? " frames=#{normalized.frames.length}" : ""
  "#<#{name}#{dimensions}#{frames}>"
end