class HTTPX::Transcoder::JSON::Encoder

  1. lib/httpx/transcoder/json.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. content_type

Public Class methods

new (json)
[show source]
   # File lib/httpx/transcoder/json.rb
21 def initialize(json)
22   @raw = ::JSON.dump(json)
23   @charset = @raw.encoding.name.downcase
24 end

Public Instance methods

content_type ()
[show source]
   # File lib/httpx/transcoder/json.rb
26 def content_type
27   "application/json; charset=#{@charset}"
28 end