Module: THTP::Encoding
- Defined in:
- lib/thtp/encoding.rb
Overview
Handling of registered MIME types and protocols
Constant Summary collapse
- BINARY =
'application/vnd.apache.thrift.binary'.freeze
- COMPACT =
'application/vnd.apache.thrift.compact'.freeze
- JSON =
'application/vnd.apache.thrift.json'.freeze
Class Method Summary collapse
Class Method Details
.content_type(protocol) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/thtp/encoding.rb', line 21 def self.content_type(protocol) # this can't be a case/when because Class !=== Class if protocol == Thrift::BinaryProtocol BINARY elsif protocol == Thrift::CompactProtocol COMPACT elsif protocol == Thrift::JsonProtocol JSON end end |