Sha256: 8255a921669d7eebc15664a55670fef9180041a5654a16a39328c7877e2bd9e0
Contents?: true
Size: 551 Bytes
Versions: 7
Compression:
Stored size: 551 Bytes
Contents
module Faker class Fillmurray < Base class << self def image(grayscale = false, width = 200, height = 200) raise ArgumentError, "Width should be a number" unless width.to_s.match(/^\d+$/) raise ArgumentError, "Height should be a number" unless height.to_s.match(/^\d+$/) raise ArgumentError, "Grayscale should be a boolean" unless [true, false].include?(grayscale) grayscale == true ? "https://fillmurray.com/g/#{width}/#{height}" : "https://fillmurray.com/#{width}/#{height}" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems