class ActiveWebhook::Formatting::URLEncodedAdapter

Protected Class Methods

compact(h) click to toggle source
# File lib/active_webhook/formatting/url_encoded_adapter.rb, line 10
def self.compact(h)
  h.delete_if { |k, v|
    v = compact(v) if v.respond_to?(:each)
    v.nil? || v.empty?
  }
end

Protected Instance Methods

content_type() click to toggle source
# File lib/active_webhook/formatting/url_encoded_adapter.rb, line 17
def content_type
  "application/x-www-form-urlencoded"
end
encoded_data() click to toggle source
# File lib/active_webhook/formatting/url_encoded_adapter.rb, line 21
def encoded_data
  uri = Addressable::URI.new
  uri.query_values = self.class.compact(data)
  uri.query
end