Class: OsCtld::Config::CpuPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/osctld/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, cfg) ⇒ CpuPackage

Returns a new instance of CpuPackage.



51
52
53
54
55
# File 'lib/osctld/config.rb', line 51

def initialize(id, cfg)
  @id = id.to_i
  @enable = cfg.fetch('enable', true)
  @cpu_mask = OsCtl::Lib::CpuMask.new(cfg.fetch('cpu_mask', '*'))
end

Instance Attribute Details

#cpu_maskOsCtl::Lib::CpuMask (readonly)

Returns:

  • (OsCtl::Lib::CpuMask)


49
50
51
# File 'lib/osctld/config.rb', line 49

def cpu_mask
  @cpu_mask
end

#enableBoolean (readonly) Also known as: enable?

Returns:

  • (Boolean)


45
46
47
# File 'lib/osctld/config.rb', line 45

def enable
  @enable
end

#idInteger (readonly)

Returns:

  • (Integer)


42
43
44
# File 'lib/osctld/config.rb', line 42

def id
  @id
end