Class: Faker::Device

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/device.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.build_numberInteger

Produces a build number between 1 and 500.

Examples:

Faker::Device.build_number #=> 5

Returns:

  • (Integer)

Available since:

  • 1.9.0


15
16
17
# File 'lib/faker/default/device.rb', line 15

def build_number
  Faker::Number.between(from: 1, to: 500)
end

.manufacturerString

Produces the name of a manufacturer for a device.

Examples:

Faker::Device.manufacturer #=> "Apple"

Returns:

  • (String)

Available since:

  • 1.9.0


28
29
30
# File 'lib/faker/default/device.rb', line 28

def manufacturer
  fetch('device.manufacturer')
end

.model_nameString

Produces a model name for a device.

Examples:

Faker::Device.model_name #=> "iPhone 4"

Returns:

  • (String)

Available since:

  • 1.9.0


41
42
43
# File 'lib/faker/default/device.rb', line 41

def model_name
  fetch('device.model_name')
end

.platformString

Produces the name of a platform for a device.

Examples:

Faker::Device.platform #=> "webOS"

Returns:

  • (String)

Available since:

  • 1.9.0


54
55
56
# File 'lib/faker/default/device.rb', line 54

def platform
  fetch('device.platform')
end

.serialString

Produces a serial code for a device.

Examples:

Faker::Device.serial #=> "ejfjnRNInxh0363JC2WM"

Returns:

  • (String)

Available since:

  • 1.9.0


67
68
69
# File 'lib/faker/default/device.rb', line 67

def serial
  fetch('device.serial')
end

.versionInteger

Produces a version number between 1 and 1000.

Examples:

Faker::Device.version #=> 42

Returns:

  • (Integer)

Available since:

  • 1.9.0


80
81
82
# File 'lib/faker/default/device.rb', line 80

def version
  Faker::Number.between(from: 1, to: 1000)
end