Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/logstash/filters/rest.rb
Overview
Monkey Patch Array with deep freeze
Instance Method Summary collapse
Instance Method Details
#compact ⇒ Object
21 22 23 |
# File 'lib/logstash/filters/rest.rb', line 21 def compact delete_if { |v| v.respond_to?(:each) ? v.compact.empty? : v.nil? } end |
#deep_freeze ⇒ Object
25 26 27 28 |
# File 'lib/logstash/filters/rest.rb', line 25 def deep_freeze each { |j| j.deep_freeze if j.respond_to? :deep_freeze } freeze end |