Class: Uploadcare::Internal::UserAgent
- Inherits:
-
Object
- Object
- Uploadcare::Internal::UserAgent
- Defined in:
- lib/uploadcare/internal/user_agent.rb
Overview
User-Agent string builder for Uploadcare API requests.
Generates a standardized User-Agent header that identifies the Ruby gem version, public key, Ruby version, and optional framework information.
Class Method Summary collapse
-
.call(config: Uploadcare.configuration) ⇒ String
Build a User-Agent string.
Class Method Details
.call(config: Uploadcare.configuration) ⇒ String
Build a User-Agent string.
16 17 18 19 20 21 |
# File 'lib/uploadcare/internal/user_agent.rb', line 16 def self.call(config: Uploadcare.configuration) framework_data = config.framework_data.to_s framework_suffix = framework_data.empty? ? '' : "; #{framework_data}" public_key = config.public_key "UploadcareRuby/#{Uploadcare::VERSION}/#{public_key} (Ruby/#{RUBY_VERSION}#{framework_suffix})" end |