Class: ThinkingData::CaseSensitivePost

Inherits:
Net::HTTP::Post
  • Object
show all
Defined in:
lib/thinkingdata-ruby/td_batch_consumer.rb

Overview

Private class. Send data tools

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object



137
138
139
# File 'lib/thinkingdata-ruby/td_batch_consumer.rb', line 137

def [](name)
  @header[name.to_s]
end

#[]=(name, val) ⇒ Object



141
142
143
144
145
146
147
# File 'lib/thinkingdata-ruby/td_batch_consumer.rb', line 141

def []=(name, val)
  if val
    @header[name.to_s] = [val]
  else
    @header.delete(name.to_s)
  end
end

#capitalize(name) ⇒ Object



149
150
151
# File 'lib/thinkingdata-ruby/td_batch_consumer.rb', line 149

def capitalize(name)
  name
end

#initialize_http_header(headers) ⇒ Object



132
133
134
135
# File 'lib/thinkingdata-ruby/td_batch_consumer.rb', line 132

def initialize_http_header(headers)
  @header = {}
  headers.each{|k,v| @header[k.to_s] = [v] }
end