Sha256: f25372a314fdf4df1546131a86132b9270333f4fed25a98926c142e7e2d6c659
Contents?: true
Size: 696 Bytes
Versions: 14
Compression:
Stored size: 696 Bytes
Contents
require 'image_optim/path' class ImageOptim # Holds optimized image with reference to original and its size class OptimizedPath < DelegateClass(Path) def initialize(path, original_or_size = nil) path = Path.convert(path) __setobj__(path) if original_or_size.is_a?(Integer) @original = path @original_size = original_or_size elsif original_or_size @original = Path.convert(original_or_size) @original_size = @original.size end end # Original path, use original_size to get its size as original can be # overwritten attr_reader :original # Stored size of original attr_reader :original_size end end
Version data entries
14 entries across 14 versions & 2 rubygems