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 more YARD docs #1740

Merged
merged 21 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Faker
[![Build Status](https://travis-ci.org/faker-ruby/faker.svg?branch=master)](https://travis-ci.org/faker-ruby/faker)
[![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
[![Inline docs](http://inch-ci.org/github/stympy/faker.svg?branch=master)](http://inch-ci.org/github/stympy/faker)
[![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
[![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/maintainability)](https://codeclimate.com/github/stympy/faker/maintainability)

Expand Down
18 changes: 18 additions & 0 deletions lib/faker/default/appliance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@
module Faker
class Appliance < Base
class << self
##
# Produces the name of an appliance brand.
#
# @return [String]
#
# @example
# Faker::Appliance.brand #=> "Bosch"
#
# @faker.version 1.9.0
def brand
fetch('appliance.brand')
end

##
# Produces the name of a type of appliance equipment.
#
# @return [String]
#
# @example
# Faker::Appliance.equipment #=> "Appliance plug"
#
# @faker.version 1.9.0
def equipment
fetch('appliance.equipment')
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

END

Expand Down
27 changes: 27 additions & 0 deletions lib/faker/default/dessert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,41 @@ class Dessert < Base
flexible :dessert

class << self
##
# Produces the name of a dessert variety.
#
# @return [String]
#
# @example
# Faker::Dessert.variety #=> "Cake"
#
# @faker.version 1.8.0
def variety
fetch('dessert.variety')
end

##
# Produces the name of a dessert topping.
#
# @return [String]
#
# @example
# Faker::Dessert.topping #=> "Gummy Bears"
#
# @faker.version 1.8.0
def topping
fetch('dessert.topping')
end

##
# Produces the name of a dessert flavor.
#
# @return [String]
#
# @example
# Faker::Dessert.flavor #=> "Salted Caramel"
#
# @faker.version 1.8.0
def flavor
fetch('dessert.flavor')
end
Expand Down
54 changes: 54 additions & 0 deletions lib/faker/default/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,80 @@
module Faker
class Device < Base
class << self
##
# Produces a build number between 1 and 500.
#
# @return [Integer]
#
# @example
# Faker::Device.build_number #=> 5
#
# @faker.version 1.9.0
def build_number
Faker::Number.between(from: 1, to: 500)
end

##
# Produces the name of a manufacturer for a device.
#
# @return [String]
#
# @example
# Faker::Device.manufacturer #=> "Apple"
#
# @faker.version 1.9.0
def manufacturer
fetch('device.manufacturer')
end

##
# Produces a model name for a device.
#
# @return [String]
#
# @example
# Faker::Device.model_name #=> "iPhone 4"
#
# @faker.version 1.9.0
def model_name
fetch('device.model_name')
end

##
# Produces the name of a platform for a device.
#
# @return [String]
#
# @example
# Faker::Device.platform #=> "webOS"
#
# @faker.version 1.9.0
def platform
fetch('device.platform')
end

##
# Produces a serial code for a device.
#
# @return [String]
#
# @example
# Faker::Device.serial #=> "ejfjnRNInxh0363JC2WM"
#
# @faker.version 1.9.0
def serial
fetch('device.serial')
end

##
# Produces a version number between 1 and 1000.
#
# @return [Integer]
#
# @example
# Faker::Device.version #=> 42
#
# @faker.version 1.9.0
def version
Faker::Number.between(from: 1, to: 1000)
end
Expand Down
27 changes: 27 additions & 0 deletions lib/faker/default/electrical_components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,41 @@ class ElectricalComponents < Base
flexible :electrical_components

class << self
##
# Produces an active electrical component.
#
# @return [String]
#
# @example
# Faker::ElectricalComponents.active #=> "Transistor"
#
# @faker.version 1.9.0
def active
fetch('electrical_components.active')
end

##
# Produces a passive electrical component.
#
# @return [String]
#
# @example
# Faker::ElectricalComponents.passive #=> "Resistor"
#
# @faker.version 1.9.0
def passive
fetch('electrical_components.passive')
end

##
# Produces an electromechanical electrical component.
#
# @return [String]
#
# @example
# Faker::ElectricalComponents.electromechanical #=> "Toggle Switch"
#
# @faker.version 1.9.0
def electromechanical
fetch('electrical_components.electromechanical')
end
Expand Down
18 changes: 18 additions & 0 deletions lib/faker/default/greek_philosophers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@
module Faker
class GreekPhilosophers < Base
class << self
##
# Produces the name of a Greek philosopher.
#
# @return [String]
#
# @example
# Faker::GreekPhilosophers.name #=> "Socrates"
#
# @faker.version 1.9.0
def name
fetch('greek_philosophers.names')
end

##
# Produces a quote from a Greek philosopher.
#
# @return [String]
#
# @example
# Faker::GreekPhilosophers.quote #=> "Only the educated are free."
#
# @faker.version 1.9.0
def quote
fetch('greek_philosophers.quotes')
end
Expand Down
36 changes: 36 additions & 0 deletions lib/faker/default/industry_segments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,54 @@ class IndustrySegments < Base
flexible :industry_segments

class << self
##
# Produces the name of an industry.
#
# @return [String]
#
# @example
# Faker::IndustrySegments.industry #=> "Basic Materials"
#
# @faker.version 1.9.2
def industry
fetch('industry_segments.industry')
end

##
# Produces the name of a super-sector of an industry.
#
# @return [String]
#
# @example
# Faker::IndustrySegments.super_sector #=> "Basic Resources"
#
# @faker.version 1.9.2
def super_sector
fetch('industry_segments.super_sector')
end

##
# Produces the name of a sector of an industry.
#
# @return [String]
#
# @example
# Faker::IndustrySegments.sector #=> "Industrial Metals & Mining"
#
# @faker.version 1.9.2
def sector
fetch('industry_segments.sector')
end

##
# Produces the name of a subsector of an industry.
#
# @return [String]
#
# @example
# Faker::IndustrySegments.industry #=> "Basic Materials"
#
# @faker.version 1.9.2
def sub_sector
fetch('industry_segments.sub_sector')
end
Expand Down
9 changes: 9 additions & 0 deletions lib/faker/default/marketing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ class Marketing < Base
flexible :marketing

class << self
##
# Produces the name of a video game console or platform.
#
# @return [String]
#
# @example
# Faker::Marketing.buzzwords #=> "rubber meets the road"
#
# @faker.version 1.9.4
def buzzwords
fetch('marketing.buzzwords')
end
Expand Down
45 changes: 45 additions & 0 deletions lib/faker/default/military.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,67 @@
module Faker
class Military < Base
class << self
##
# Produces a rank in the U.S. Army.
#
# @return [String]
#
# @example
# Faker::Military.army_rank #=> "Staff Sergeant"
#
# @faker.version 1.9.0
def army_rank
fetch('military.army_rank')
end

##
# Produces a rank in the U.S. Marines.
#
# @return [String]
#
# @example
# Faker::Military.marines_rank #=> "Gunnery Sergeant"
#
# @faker.version 1.9.0
def marines_rank
fetch('military.marines_rank')
end

##
# Produces a rank in the U.S. Navy.
#
# @return [String]
#
# @example
# Faker::Military.navy_rank #=> "Seaman"
#
# @faker.version 1.9.0
def navy_rank
fetch('military.navy_rank')
end

##
# Produces a rank in the U.S. Air Force.
#
# @return [String]
#
# @example
# Faker::Military.air_force_rank #=> "Captain"
#
# @faker.version 1.9.0
def air_force_rank
fetch('military.air_force_rank')
end

##
# Produces a U.S. Department of Defense Paygrade.
#
# @return [String]
#
# @example
# Faker::Military.dod_paygrade #=> "E-6"
#
# @faker.version 1.9.0
def dod_paygrade
fetch('military.dod_paygrade')
end
Expand Down
9 changes: 9 additions & 0 deletions lib/faker/default/nato_phonetic_alphabet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
module Faker
class NatoPhoneticAlphabet < Base
class << self
##
# Produces a code word from the NATO phonetic alphabet.
#
# @return [String]
#
# @example
# Faker::NatoPhoneticAlphabet.code_word #=> "Hotel"
#
# @faker.version 1.9.0
def code_word
fetch('nato_phonetic_alphabet.code_word')
end
Expand Down
Loading