Sha256: 28942cf1f1edf901d264c70670dde48f0c8d73f937273dabfd7e5e0196a3f0ba

Contents?: true

Size: 1.7 KB

Versions: 37

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

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
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
faker-3.5.1 lib/faker/default/device.rb
faker-3.4.2 lib/faker/default/device.rb
faker-3.4.1 lib/faker/default/device.rb
faker-3.3.1 lib/faker/default/device.rb
faker-3.3.0 lib/faker/default/device.rb
faker-3.2.3 lib/faker/default/device.rb
faker-3.2.2 lib/faker/default/device.rb
faker-3.2.1 lib/faker/default/device.rb
faker-3.2.0 lib/faker/default/device.rb
faker-3.1.1 lib/faker/default/device.rb
faker-3.1.0 lib/faker/default/device.rb
faker-3.0.0 lib/faker/default/device.rb
faker-2.23.0 lib/faker/default/device.rb
faker-2.22.0 lib/faker/default/device.rb
faker-2.21.0 lib/faker/default/device.rb
faker-2.20.0 lib/faker/default/device.rb
faker-2.19.0 lib/faker/default/device.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/bundler/gems/faker-e1bd4a5a5777/lib/faker/default/device.rb
faker-2.18.0 lib/faker/default/device.rb
faker-2.17.0 lib/faker/default/device.rb