Class: Faker::Fillmurray
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.image(legacy_grayscale = NOT_GIVEN, legacy_width = NOT_GIVEN, legacy_height = NOT_GIVEN, grayscale: false, width: 200, height: 200) ⇒ String
Produces the URL of an image from Fill Murray, a site which hosts exclusively photographs of actor Bill Murray.
Methods inherited from Base
bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale
Class Method Details
.image(legacy_grayscale = NOT_GIVEN, legacy_width = NOT_GIVEN, legacy_height = NOT_GIVEN, grayscale: false, width: 200, height: 200) ⇒ String
Produces the URL of an image from Fill Murray, a site which hosts exclusively photographs of actor Bill Murray.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/faker/default/fillmurray.rb', line 29 def image(legacy_grayscale = NOT_GIVEN, legacy_width = NOT_GIVEN, legacy_height = NOT_GIVEN, grayscale: false, width: 200, height: 200) warn_for_deprecated_arguments do |keywords| keywords << :grayscale if legacy_grayscale != NOT_GIVEN keywords << :width if legacy_width != NOT_GIVEN keywords << :height if legacy_height != NOT_GIVEN end raise ArgumentError, 'Width should be a number' unless width.to_s =~ /^\d+$/ raise ArgumentError, 'Height should be a number' unless height.to_s =~ /^\d+$/ raise ArgumentError, 'Grayscale should be a boolean' unless [true, false].include?(grayscale) "https://www.fillmurray.com#{'/g' if grayscale == true}/#{width}/#{height}" end |