Class: OsCtld::PrLimits::PrLimit
- Inherits:
-
Object
- Object
- OsCtld::PrLimits::PrLimit
- Defined in:
- lib/osctld/prlimits/prlimit.rb
Instance Attribute Summary collapse
-
#hard ⇒ Object
readonly
Returns the value of attribute hard.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#soft ⇒ Object
readonly
Returns the value of attribute soft.
Class Method Summary collapse
-
.load(name, cfg) ⇒ Object
Load from config.
Instance Method Summary collapse
-
#dump ⇒ Object
Dump to config.
-
#export ⇒ Object
Export to client.
-
#initialize(name, soft, hard) ⇒ PrLimit
constructor
A new instance of PrLimit.
- #set(soft, hard) ⇒ Object
Constructor Details
#initialize(name, soft, hard) ⇒ PrLimit
Returns a new instance of PrLimit.
10 11 12 13 14 |
# File 'lib/osctld/prlimits/prlimit.rb', line 10 def initialize(name, soft, hard) @name = name @soft = soft @hard = hard end |
Instance Attribute Details
#hard ⇒ Object (readonly)
Returns the value of attribute hard.
3 4 5 |
# File 'lib/osctld/prlimits/prlimit.rb', line 3 def hard @hard end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/osctld/prlimits/prlimit.rb', line 3 def name @name end |
#soft ⇒ Object (readonly)
Returns the value of attribute soft.
3 4 5 |
# File 'lib/osctld/prlimits/prlimit.rb', line 3 def soft @soft end |
Class Method Details
.load(name, cfg) ⇒ Object
Load from config
6 7 8 |
# File 'lib/osctld/prlimits/prlimit.rb', line 6 def self.load(name, cfg) new(name, cfg['soft'], cfg['hard']) end |
Instance Method Details
#dump ⇒ Object
Dump to config
27 28 29 |
# File 'lib/osctld/prlimits/prlimit.rb', line 27 def dump { 'soft' => soft, 'hard' => hard } end |
#export ⇒ Object
Export to client
22 23 24 |
# File 'lib/osctld/prlimits/prlimit.rb', line 22 def export { soft:, hard: } end |
#set(soft, hard) ⇒ Object
16 17 18 19 |
# File 'lib/osctld/prlimits/prlimit.rb', line 16 def set(soft, hard) @soft = soft @hard = hard end |