module AppleCore::Refinements::QueryString

Public Instance Methods

to_param() click to toggle source
# File lib/apple_core/refinements/query_string.rb, line 8
def to_param
  map(&:to_param).join('/')
end
to_query(key) click to toggle source
# File lib/apple_core/refinements/query_string.rb, line 12
def to_query(key)
  prefix = "#{key}[]"

  return nil.to_query(prefix) if empty?

  map { |value| value.to_query(prefix) }
    .join('&')
end