Class: BraintreeHttp::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/braintreehttp/encoder.rb

Instance Method Summary collapse

Instance Method Details

#content_typeObject



54
55
56
# File 'lib/braintreehttp/encoder.rb', line 54

def content_type
  /^application\/json$/
end

#decode(body) ⇒ Object



50
51
52
# File 'lib/braintreehttp/encoder.rb', line 50

def decode(body)
  JSON.parse(body)
end

#encode(request) ⇒ Object



46
47
48
# File 'lib/braintreehttp/encoder.rb', line 46

def encode(request)
  JSON.generate(request.body)
end