Sha256: 9e175f7449dd6b28964fb2a443a846c8a709ef350f3b0927af0ecedbfa647c81

Contents?: true

Size: 463 Bytes

Versions: 13

Compression:

Stored size: 463 Bytes

Contents

module Algolia
  class UserAgent
    attr_accessor :value

    def initialize
      @value = "Algolia for Ruby (#{VERSION}); Ruby (#{RUBY_VERSION})"
    end

    # Adds a segment to the UserAgent
    #
    def add(segment, version = nil)
      if version.nil?
        @value += format("; %<segment>s", segment: segment)
      else
        @value += format("; %<segment>s (%<version>s)", segment: segment, version: version)
      end

      self
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
algolia-3.12.0 lib/algolia/user_agent.rb
algolia-3.11.0 lib/algolia/user_agent.rb
algolia-3.10.2 lib/algolia/user_agent.rb
algolia-3.10.1 lib/algolia/user_agent.rb
algolia-3.8.2 lib/algolia/user_agent.rb
algolia-3.8.1 lib/algolia/user_agent.rb
algolia-3.8.0 lib/algolia/user_agent.rb
algolia-3.7.1 lib/algolia/user_agent.rb
algolia-3.7.0 lib/algolia/user_agent.rb
algolia-3.6.0 lib/algolia/user_agent.rb
algolia-3.5.4 lib/algolia/user_agent.rb
algolia-3.5.3 lib/algolia/user_agent.rb
algolia-3.5.2 lib/algolia/user_agent.rb