mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 09:17:05 +02:00
`Class.new {...}` uses a closure to define a class. Closure keeps environment that includes local variables and so on. Assignment changes the environment. So `klass = Class.new { KEYS = [] }` doesn't define `klass::KEYS`. It defines `Object::KEYS`. a = 1 Class.new do a = 2 X = 3 end p a # => 2 p X # => 3 We need to use `const_set` to define a constant in `Class.new {...}`. |
||
---|---|---|
.. | ||
setting | ||
agent_spec.rb |