Class: PostData

Inherits:
Hash
  • Object
show all
Defined in:
lib/active_merchant/lib/post_data.rb

Instance Method Summary collapse

Instance Method Details

#[]=(key, value) ⇒ Object



7
8
9
10
# File 'lib/active_merchant/lib/post_data.rb', line 7

def []=(key, value)
  return if value.blank? && !required?(key)
  super
end

#to_post_dataObject Also known as: to_s



12
13
14
# File 'lib/active_merchant/lib/post_data.rb', line 12

def to_post_data
  collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&")  
end