Class: BraintreeHttp::Json

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

Instance Method Summary collapse

Instance Method Details

#content_typeObject



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

def content_type
  /^application\/json$/
end

#decode(body) ⇒ Object



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

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

#encode(request) ⇒ Object



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

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