Module: OAuth::Helper

Defined in:
lib/atig/oauth-patch.rb

Instance Method Summary collapse

Instance Method Details

#escape(value) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/atig/oauth-patch.rb', line 8

def escape(value)
  begin
    URI::escape(value.to_s, OAuth::RESERVED_CHARACTERS)
  rescue ArgumentError
    URI::escape(
      value.to_s.force_encoding(Encoding::UTF_8),
      OAuth::RESERVED_CHARACTERS
    )
  end
end