Class: Qa::Authorities::AssignFast::SpaceFixEncoder

Inherits:
Object
  • Object
show all
Defined in:
lib/qa/authorities/assign_fast/space_fix_encoder.rb

Overview

for use with Faraday; encode spaces as ‘%20’ not ‘+’

Instance Method Summary collapse

Instance Method Details

#decode(str) ⇒ Object



9
10
11
# File 'lib/qa/authorities/assign_fast/space_fix_encoder.rb', line 9

def decode(str)
  Faraday::NestedParamsEncoder.decode(str)
end

#encode(hash) ⇒ Object



4
5
6
7
# File 'lib/qa/authorities/assign_fast/space_fix_encoder.rb', line 4

def encode(hash)
  encoded = Faraday::NestedParamsEncoder.encode(hash)
  encoded.gsub('+', '%20')
end