Class: CocoaPodsStats::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods_stats/sender.rb

Constant Summary collapse

API_URL =
'https://stats.cocoapods.org/api/v1/install'.freeze

Instance Method Summary collapse

Instance Method Details

#send(targets, pod_try: false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cocoapods_stats/sender.rb', line 7

def send(targets, pod_try: false)
  body = {
    :targets => targets,
    :cocoapods_version => Pod::VERSION,
    :pod_try => pod_try,
  }
  headers = {
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
  }
  curl(API_URL, body, headers)
end