class Faker::Computer
Public Class Methods
os(platform: self.platform)
click to toggle source
Produces the name of a computer os.
@param platform [String] optionally specify the platform `linux`, `macos`, or `windows`. @return [String]
@example
Faker::Computer.os #=> "RHEL 6.10"
@faker.version 2.12.0
# 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()
click to toggle source
Produces the name of a computer platform.
@return [String]
@example
Faker::Computer.platform #=> "Linux"
@faker.version 2.12.0
# File lib/faker/default/computer.rb, line 15 def platform fetch('computer.platform') end
stack()
click to toggle source
Produces a string with computer platform and os
@return [String]
@example
Faker::Computer.stack #=> "Linux, RHEL 6.10"
@faker.version 2.12.0
# File lib/faker/default/computer.rb, line 56 def stack platform = self.platform os = fetch("computer.os.#{platform.downcase}") "#{platform}, #{os}" end
type()
click to toggle source
Produces the name of a computer type.
@return [String]
@example
Faker::Computer.type #=> "server"
@faker.version 2.12.0
# File lib/faker/default/computer.rb, line 28 def type fetch('computer.type') end