Module: Cardiac::Representation::Codecs::UrlEncoded

Extended by:
Extensions
Includes:
Extensions
Defined in:
lib/cardiac/representation.rb

Defined Under Namespace

Modules: Extensions

Class Method Summary collapse

Methods included from Cardiac::RackUtils

#build_nested_query

Class Method Details

.decode(value, options = {}) ⇒ Object



94
95
96
97
98
# File 'lib/cardiac/representation.rb', line 94

def decode(value,options={})
  decode_form(value).inject({}) do |params,(key,value)|
    normalize_params params, key, value
  end
end

.encode(value, options = {}) ⇒ Object



90
91
92
# File 'lib/cardiac/representation.rb', line 90

def encode(value,options={})
  Hash===value ? build_nested_query(value) : encode_form(value)
end