Module: Mailgunner::Params

Defined in:
lib/mailgunner/params.rb

Class Method Summary collapse

Class Method Details

.encode(params) ⇒ Object



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

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

.escape(value) ⇒ Object



10
11
12
# File 'lib/mailgunner/params.rb', line 10

def self.escape(value)
  URI.encode_uri_component(value)
end