Class: OsCtld::CGroup::Param
- Inherits:
-
Struct
- Object
- Struct
- OsCtld::CGroup::Param
- Defined in:
- lib/osctld/cgroup/param.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#persistent ⇒ Object
Returns the value of attribute persistent.
-
#subsystem ⇒ Object
Returns the value of attribute subsystem.
-
#value ⇒ Object
Returns the value of attribute value.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
-
.import(hash) ⇒ Object
Load from client.
-
.load(hash) ⇒ Object
Load from config.
Instance Method Summary collapse
-
#dump ⇒ Object
Dump to config.
-
#export ⇒ Object
Export to client.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
3 4 5 |
# File 'lib/osctld/cgroup/param.rb', line 3 def name @name end |
#persistent ⇒ Object
Returns the value of attribute persistent
3 4 5 |
# File 'lib/osctld/cgroup/param.rb', line 3 def persistent @persistent end |
#subsystem ⇒ Object
Returns the value of attribute subsystem
3 4 5 |
# File 'lib/osctld/cgroup/param.rb', line 3 def subsystem @subsystem end |
#value ⇒ Object
Returns the value of attribute value
3 4 5 |
# File 'lib/osctld/cgroup/param.rb', line 3 def value @value end |
#version ⇒ Object
Returns the value of attribute version
3 4 5 |
# File 'lib/osctld/cgroup/param.rb', line 3 def version @version end |
Class Method Details
.import(hash) ⇒ Object
Load from client
16 17 18 19 20 21 22 23 24 |
# File 'lib/osctld/cgroup/param.rb', line 16 def self.import(hash) new( hash.fetch(:version, CGroup.version), hash[:subsystem], hash[:parameter], hash[:value], hash.has_key?(:persistent) ? hash[:persistent] : true ) end |
.load(hash) ⇒ Object
Load from config
5 6 7 8 9 10 11 12 13 |
# File 'lib/osctld/cgroup/param.rb', line 5 def self.load(hash) new( hash.fetch('version', 1), hash['subsystem'], hash['name'], hash['value'], true ) end |
Instance Method Details
#dump ⇒ Object
Dump to config
27 28 29 |
# File 'lib/osctld/cgroup/param.rb', line 27 def dump to_h.transform_keys(&:to_s) end |
#export ⇒ Object
Export to client
32 33 34 35 36 37 38 39 40 |
# File 'lib/osctld/cgroup/param.rb', line 32 def export { version:, subsystem:, parameter: name, value:, persistent: persistent ? true : false } end |