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 for Faker::Compass #1975

Merged
merged 1 commit into from May 14, 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
135 changes: 135 additions & 0 deletions lib/faker/default/compass.rb
Expand Up @@ -3,62 +3,197 @@
module Faker
class Compass < Base
class << self
##
# Produces a random cardinal.
#
# @return [String]
#
# @example
# Faker::Compass.cardinal #=> "north"
#
# @faker.version 1.8.0
def cardinal
fetch('compass.cardinal.word')
end

##
# Produces a random ordinal.
#
# @return [String]
#
# @example
# Faker::Compass.ordinal #=> "northwest"
#
# @faker.version 1.8.0
def ordinal
fetch('compass.ordinal.word')
end

##
# Produces a random half wind.
#
# @return [String]
#
# @example
# Faker::Compass.half_wind #=> "north-northwest"
#
# @faker.version 1.8.0
def half_wind
fetch('compass.half-wind.word')
end

##
# Produces a random quarter wind.
#
# @return [String]
#
# @example
# Faker::Compass.quarter_wind #=> "north by west"
#
# @faker.version 1.8.0
def quarter_wind
fetch('compass.quarter-wind.word')
end

##
# Produces a random direction.
#
# @return [String]
#
# @example
# Faker::Compass.direction #=> "southeast"
#
# @faker.version 1.8.0
def direction
parse('compass.direction')
end

##
# Produces a random abbreviation.
#
# @return [String]
#
# @example
# Faker::Compass.abbreviation #=> "NEbN"
#
# @faker.version 1.8.0
def abbreviation
parse('compass.abbreviation')
end

##
# Produces a random azimuth.
#
# @return [String]
#
# @example
# Faker::Compass.azimuth #=> "168.75"
#
# @faker.version 1.8.0
def azimuth
parse('compass.azimuth')
end

##
# Produces a random cardinal abbreviation.
#
# @return [String]
#
# @example
# Faker::Compass.cardinal_abbreviation #=> "N"
#
# @faker.version 1.8.0
def cardinal_abbreviation
fetch('compass.cardinal.abbreviation')
end

##
# Produces a random ordinal abbreviation.
#
# @return [String]
#
# @example
# Faker::Compass.ordinal_abbreviation #=> "SW"
#
# @faker.version 1.8.0
def ordinal_abbreviation
fetch('compass.ordinal.abbreviation')
end

##
# Produces a random half wind abbreviation.
#
# @return [String]
#
# @example
# Faker::Compass.half_wind_abbreviation #=> "NNE"
#
# @faker.version 1.8.0
def half_wind_abbreviation
fetch('compass.half-wind.abbreviation')
end

##
# Produces a random quarter wind abbreviation.
#
# @return [String]
#
# @example
# Faker::Compass.quarter_wind_abbreviation #=> "SWbS"
#
# @faker.version 1.8.0
def quarter_wind_abbreviation
fetch('compass.quarter-wind.abbreviation')
end

##
# Produces a random cardinal azimuth.
#
# @return [String]
#
# @example
# Faker::Compass.cardinal_azimuth #=> "90"
#
# @faker.version 1.8.0
def cardinal_azimuth
fetch('compass.cardinal.azimuth')
end

##
# Produces a random ordinal azimuth.
#
# @return [String]
#
# @example
# Faker::Compass.ordinal_azimuth #=> "135"
#
# @faker.version 1.8.0
def ordinal_azimuth
fetch('compass.ordinal.azimuth')
end

##
# Produces a random half wind azimuth.
#
# @return [String]
#
# @example
# Faker::Compass.half_wind_azimuth #=> "292.5"
#
# @faker.version 1.8.0
def half_wind_azimuth
fetch('compass.half-wind.azimuth')
end

##
# Produces a random quarter wind azimuth
#
# @return [String]
#
# @example
# Faker::Compass.quarter_wind_azimuth #=> "56.25"
#
# @faker.version 1.8.0
def quarter_wind_azimuth
fetch('compass.quarter-wind.azimuth')
end
Expand Down