Faraday::Response::Middleware
Public: Converts parsed response bodies to a Hashie::Mash if they were of Hash or Array type.
# File lib/faraday_middleware/response/mashify.rb, line 18 def initialize(app = nil, options = {}) super(app) self.mash_class = options[:mash_class] || self.class.mash_class end
# File lib/faraday_middleware/response/mashify.rb, line 23 def parse(body) case body when Hash mash_class.new(body) when Array body.map { |item| parse(item) } else body end end
[Validate]
Generated with the Darkfish Rdoc Generator 2.