Module: Chimps::Utils::HttpFormat::ClassMethods

Defined in:
lib/chimps-cli/utils/http_format.rb

Instance Method Summary collapse

Instance Method Details

#mime_type_for(fmt) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/chimps-cli/utils/http_format.rb', line 15

def mime_type_for fmt
  case fmt.to_s.tr('.','').downcase.to_sym
  when :json then 'application/json'
  when :yaml then 'application/x-yaml'
  when :tsv  then 'text/tab-separated-values'
  else            'application/json' # default
  end
end