Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YARD docs to Faker::Lorem_Pixel #2052

Merged
merged 1 commit into from Jun 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions lib/faker/default/lorem_pixel.rb
Expand Up @@ -17,6 +17,28 @@ class << self
technics
transport].freeze

##
# Produces a random image URL from lorempixel.com.
#
# @param size [String] Specifies the size of image to generate.
# @param is_gray [Boolean] Determines if the image is gray.
# @param category [Symbol] Adds the category of the generated image to the URL.
# @param number [Integer] Adds a number as part of the URL.
# @param text [Integer] Adds dummy text as part of the URL.
# @param secure [Boolean] Changes the image URL between http and https.
# @return [String]
#
# @example
# Faker::LoremPixel.image #=> "https://lorempixel.com/300/300"
# Faker::LoremPixel.image(size: "50x60") #=> "https://lorempixel.com/50/60"
# Faker::LoremPixel.image(size: "50x60", is_gray: true) #=> "https://lorempixel.com/g/50/60"
# Faker::LoremPixel.image(size: "50x60", is_gray: false, category: 'sports') #=> "https://lorempixel.com/50/60/sports"
# Faker::LoremPixel.image(size: "50x60", is_gray: false, category: 'sports', number: 3) #=> "https://lorempixel.com/50/60/sports/3"
# Faker::LoremPixel.image(size: "50x60", is_gray: false, category: 'sports', number: 3, text: 'Dummy-text') #=> "https://lorempixel.com/50/60/sports/3/Dummy-text"
# Faker::LoremPixel.image(size: "50x60", is_gray: false, category: 'sports', number: nil, text: 'Dummy-text') #=> "https://lorempixel.com/50/60/sports/Dummy-text"
# Faker::LoremPixel.image(secure: false) #=> "http://lorempixel.com/300/300"
#
# @faker.version 1.7.0
# rubocop:disable Metrics/ParameterLists
def image(legacy_size = NOT_GIVEN, legacy_is_gray = NOT_GIVEN, legacy_category = NOT_GIVEN, legacy_number = NOT_GIVEN, legacy_text = NOT_GIVEN, legacy_secure = NOT_GIVEN, size: '300x300', is_gray: false, category: nil, number: nil, text: nil, secure: true)
warn_for_deprecated_arguments do |keywords|
Expand Down