Class: LogStash::Instrument::PeriodicPoller::Cgroup::Override
- Inherits:
-
Object
- Object
- LogStash::Instrument::PeriodicPoller::Cgroup::Override
- Defined in:
- lib/logstash/instrument/periodic_poller/cgroup.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key) ⇒ Override
constructor
A new instance of Override.
- #nil? ⇒ Boolean
- #override(other) ⇒ Object
Constructor Details
#initialize(key) ⇒ Override
Returns a new instance of Override.
10 11 12 13 |
# File 'lib/logstash/instrument/periodic_poller/cgroup.rb', line 10 def initialize(key) @key = key @value = java.lang.System.getProperty(@key) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/logstash/instrument/periodic_poller/cgroup.rb', line 9 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'lib/logstash/instrument/periodic_poller/cgroup.rb', line 9 def value @value end |
Instance Method Details
#nil? ⇒ Boolean
15 16 17 |
# File 'lib/logstash/instrument/periodic_poller/cgroup.rb', line 15 def nil? value.nil? end |
#override(other) ⇒ Object
19 20 21 |
# File 'lib/logstash/instrument/periodic_poller/cgroup.rb', line 19 def override(other) nil? ? other : value end |