Method: ObjectPatch::Pointer.encode
- Defined in:
- lib/object_patch/pointer.rb
.encode(ary_path) ⇒ String
Given an array of keys this will provide a properly escaped JSONPointer path.
47 48 49 50 |
# File 'lib/object_patch/pointer.rb', line 47 def encode(ary_path) ary_path = Array(ary_path).map { |p| p.is_a?(String) ? escape(p) : p } "/" << ary_path.join("/") end |