module ImageMosaic module Data class Validator def initialize(urls) @urls = urls end def items @items ||= validate_items.compact end private def validate_items @urls.map do |url| image = Image::Child.new(url) next unless image.valid? { url: url, h: image.height, w: image.width } end end end end end