Method: HTTParty::ClassMethods#format
- Defined in:
- lib/httparty.rb
#format(f = nil) ⇒ Object
Allows setting the format with which to parse. Must be one of the allowed formats ie: json, xml
class Foo
include HTTParty
format :json
end
249 250 251 252 253 254 255 256 257 |
# File 'lib/httparty.rb', line 249 def format(f = nil) if f.nil? [:format] else parser(Parser) if parser.nil? [:format] = f validate_format end end |