Class: HeapInfo::Nil
Overview
Self define a nil like class.
Can be the return value of Process#dump and Process#dump_chunks, to prevent use the return value for calculating accidentally while exploiting remote.
Instance Method Summary collapse
-
#method_missing(method_sym, *args, &block) ⇒ HeapInfo::Nil
Hook all missing methods.
-
#respond_to_missing? ⇒ Boolean
Yap.
-
#to_ary ⇒ Array
To prevent error raised with
puts Nil.instance.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *args, &block) ⇒ HeapInfo::Nil
Hook all missing methods
23 24 25 26 27 |
# File 'lib/heapinfo/nil.rb', line 23 def method_missing(method_sym, *args, &block) # rubocop:disable Style/MethodMissingSuper return nil.__send__(method_sym, *args, &block) if nil.respond_to?(method_sym) self end |
Instance Method Details
#respond_to_missing? ⇒ Boolean
Yap
30 31 32 |
# File 'lib/heapinfo/nil.rb', line 30 def respond_to_missing?(*) super end |
#to_ary ⇒ Array
To prevent error raised with puts Nil.instance.
36 37 38 |
# File 'lib/heapinfo/nil.rb', line 36 def to_ary [] end |