Sha256: de0be2aa11c53c9873610f636a7d6a3589c2fdd9a3fbea2f9db24f8ed870d3fa

Contents?: true

Size: 697 Bytes

Versions: 4

Compression:

Stored size: 697 Bytes

Contents

module CPU
  module Shared
    # Returns the number of processors in this computer
    def num_processors
      if @num_processors
        @num_processors
      else
        CPU.num_processors
      end
    end

    # Set the number of processors (this causes them to becomed fixed in the
    # object the CPU::Shared module was mixed into).
    attr_writer :num_processors

    # Returns the number of cores in this computer
    def num_cores
      if @num_cores
        @num_cores
      else
        CPU.num_cores
      end
    end

    # Set the number of cores (this causes them to becomed fixed in the object
    # the CPU::Shared module was mixed into).
    attr_writer :num_cores
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cpu-0.0.4 lib/cpu/shared.rb
cpu-0.0.3 lib/cpu/shared.rb
cpu-0.0.2 lib/cpu/shared.rb
cpu-0.0.1 lib/cpu/shared.rb