lib/algolia/user_agent.rb in algolia-2.3.4 vs lib/algolia/user_agent.rb in algolia-3.0.0.alpha.2
- old
+ new
@@ -1,25 +1,15 @@
module Algolia
class UserAgent
attr_accessor :value
- @@value = Defaults::USER_AGENT
-
- # Set the value of the UserAgent
- #
- def self.value
- @@value
+ def initialize
+ @value = "Algolia for Ruby (#{VERSION}); Ruby (#{RUBY_VERSION})"
end
- # Resets the value of the UserAgent
- #
- def self.reset_to_default
- @@value = Defaults::USER_AGENT
- end
-
# Adds a segment to the UserAgent
#
- def self.add(segment, version)
- @@value += format('; %<segment>s (%<version>s)', segment: segment, version: version)
+ def add(segment, version)
+ @value += format('; %<segment>s (%<version>s)', segment: segment, version: version)
end
end
end