Class: Utils::Segment
- Inherits:
-
Object
- Object
- Utils::Segment
- Defined in:
- lib/xray_method_tracer/utils/segment.rb
Class Method Summary collapse
- .build_name(prefix, klass_name, method_name) ⇒ Object
- .format_args(args) ⇒ Object
- .sanitize(name) ⇒ Object
Class Method Details
.build_name(prefix, klass_name, method_name) ⇒ Object
5 6 7 |
# File 'lib/xray_method_tracer/utils/segment.rb', line 5 def self.build_name(prefix, klass_name, method_name) sanitize("#{prefix}##{klass_name}##{method_name}") end |
.format_args(args) ⇒ Object
13 14 15 |
# File 'lib/xray_method_tracer/utils/segment.rb', line 13 def self.format_args(args) args.map.with_index { |arg, index| ["arg_#{index + 1}", arg] }.to_h end |
.sanitize(name) ⇒ Object
9 10 11 |
# File 'lib/xray_method_tracer/utils/segment.rb', line 9 def self.sanitize(name) name.delete("?;*()!$~^<>") end |