Class: Uploadcare::Param::UserAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/uploadcare/param/user_agent.rb

Overview

This header is added to track libraries using Uploadcare API

Class Method Summary collapse

Class Method Details

.callObject

Generate header from Gem's config

Examples:

Uploadcare::Param::UserAgent.call

UploadcareRuby/3.0.0-dev/Pubkey_(Ruby/2.6.3;UploadcareRuby)


13
14
15
16
17
18
# File 'lib/uploadcare/param/user_agent.rb', line 13

def self.call
  framework_data = Uploadcare.config.framework_data || ''
  framework_data_string = "; #{Uploadcare.config.framework_data}" unless framework_data.empty?
  public_key = Uploadcare.config.public_key
  "UploadcareRuby/#{VERSION}/#{public_key} (Ruby/#{RUBY_VERSION}#{framework_data_string})"
end