Class: Faker::LoremFlickr
- Defined in:
- lib/faker/default/lorem_flickr.rb
Constant Summary collapse
- SUPPORTED_COLORIZATIONS =
%w[red green blue].freeze
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.colorized_image(size: '300x300', color: 'red', search_terms: ['all'], match_all: false) ⇒ String
Produces a random colorized image URL from loremflickr.com.
-
.grayscale_image(size: '300x300', search_terms: ['all'], match_all: false) ⇒ String
Produces a random grayscale image URL from loremflickr.com.
-
.image(size: '300x300', search_terms: [], match_all: false) ⇒ String
Produces a random image URL from loremflickr.com.
-
.pixelated_image(size: '300x300', search_terms: ['all'], match_all: false) ⇒ String
Produces a random pixelated image URL from loremflickr.com.
Methods inherited from Base
bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, shuffle!, translate, unique, with_locale
Class Method Details
.colorized_image(size: '300x300', color: 'red', search_terms: ['all'], match_all: false) ⇒ String
Produces a random colorized image URL from loremflickr.com.
89 90 91 92 93 94 |
# File 'lib/faker/default/lorem_flickr.rb', line 89 def colorized_image(size: '300x300', color: 'red', search_terms: ['all'], match_all: false) raise ArgumentError, 'Search terms must be specified for colorized images' unless search_terms.any? raise ArgumentError, "Supported colorizations are #{SUPPORTED_COLORIZATIONS.join(', ')}" unless SUPPORTED_COLORIZATIONS.include?(color) build_url(size, color, search_terms, match_all) end |
.grayscale_image(size: '300x300', search_terms: ['all'], match_all: false) ⇒ String
Produces a random grayscale image URL from loremflickr.com.
44 45 46 47 48 |
# File 'lib/faker/default/lorem_flickr.rb', line 44 def grayscale_image(size: '300x300', search_terms: ['all'], match_all: false) raise ArgumentError, 'Search terms must be specified for grayscale images' unless search_terms.any? build_url(size, 'g', search_terms, match_all) end |
.image(size: '300x300', search_terms: [], match_all: false) ⇒ String
Produces a random image URL from loremflickr.com.
24 25 26 |
# File 'lib/faker/default/lorem_flickr.rb', line 24 def image(size: '300x300', search_terms: [], match_all: false) build_url(size, nil, search_terms, match_all) end |
.pixelated_image(size: '300x300', search_terms: ['all'], match_all: false) ⇒ String
Produces a random pixelated image URL from loremflickr.com.
66 67 68 69 70 |
# File 'lib/faker/default/lorem_flickr.rb', line 66 def (size: '300x300', search_terms: ['all'], match_all: false) raise ArgumentError, 'Search terms must be specified for pixelated images' unless search_terms.any? build_url(size, 'p', search_terms, match_all) end |