Class: Faker::Computer
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.os(platform: self.platform) ⇒ String
Produces the name of a computer os.
-
.platform ⇒ String
Produces the name of a computer platform.
-
.stack ⇒ String
Produces a string with computer platform and os.
-
.type ⇒ String
Produces the name of a computer type.
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
.os(platform: self.platform) ⇒ String
Produces the name of a computer os.
42 43 44 45 |
# File 'lib/faker/default/computer.rb', line 42 def os(platform: self.platform) platform = self.platform unless fetch_all('computer.platform').include?(platform) fetch("computer.os.#{platform.downcase}") end |
.platform ⇒ String
Produces the name of a computer platform.
15 16 17 |
# File 'lib/faker/default/computer.rb', line 15 def platform fetch('computer.platform') end |
.stack ⇒ String
Produces a string with computer platform and os
56 57 58 59 60 |
# File 'lib/faker/default/computer.rb', line 56 def stack platform = self.platform os = fetch("computer.os.#{platform.downcase}") "#{platform}, #{os}" end |
.type ⇒ String
Produces the name of a computer type.
28 29 30 |
# File 'lib/faker/default/computer.rb', line 28 def type fetch('computer.type') end |