Module: Nexmo::Params

Defined in:
lib/nexmo/params.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.encode(params) ⇒ Object



6
7
8
# File 'lib/nexmo/params.rb', line 6

def self.encode(params)
  params.flat_map { |k, vs| Array(vs).map { |v| "#{escape(k)}=#{escape(v)}" } }.join('&')
end

.join(string, params) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/nexmo/params.rb', line 10

def self.join(string, params)
  encoded = encode(params)

  return encoded if string.nil?

  string + '&' + encoded
end