Module: Chimps::Utils::HttpFormat

Included in:
Commands::Delete, Commands::Get, Commands::List, Commands::Me, Commands::Post, Commands::Put, Commands::Search, Commands::Show
Defined in:
lib/chimps-cli/utils/http_format.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
# File 'lib/chimps-cli/utils/http_format.rb', line 6

def self.included klass
  klass.extend(ClassMethods)
end

Instance Method Details

#headersObject



29
30
31
32
33
34
# File 'lib/chimps-cli/utils/http_format.rb', line 29

def headers
  {
    :content_type => self.class.mime_type_for(request_fmt),
    :accept       => self.class.mime_type_for(response_fmt)
  }
end

#normalize_fmt(string) ⇒ Object



25
26
27
# File 'lib/chimps-cli/utils/http_format.rb', line 25

def normalize_fmt string
  string.to_s.downcase.tr('.','')
end