Module: StackifyRubyAPM::NaivelyHashable Private
- Included in:
- Context, Context::Prefix, Context::Request, Context::Request::Headers, Context::Request::Socket, Context::Request::Url, Context::Response, Span::Context, Stacktrace::Frame
- Defined in:
- lib/stackify_apm/naively_hashable.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #naively_hashable? ⇒ Boolean private
- #to_h ⇒ Object private
Instance Method Details
#naively_hashable? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/stackify_apm/naively_hashable.rb', line 8 def naively_hashable? true end |
#to_h ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/stackify_apm/naively_hashable.rb', line 12 def to_h instance_variables.each_with_object({}) do |name, h| key = name.to_s.delete('@').to_sym value = instance_variable_get(name) is_hashable = value.respond_to?(:naively_hashable?) && value.naively_hashable? h[key] = is_hashable ? value.to_h : value end end |