Class: LogStash::Instrument::PeriodicPoller::Cgroup::Override

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/instrument/periodic_poller/cgroup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/logstash/instrument/periodic_poller/cgroup.rb', line 9

def key
  @key
end

#valueObject (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

Returns:

  • (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