Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / logstash   deb

Repository URL to install this package:

/ opt / logstash / vendor / bundle / jruby / 1.9 / gems / user_agent_parser-2.1.2 / lib / user_agent_parser / operating_system.rb

module UserAgentParser
  class OperatingSystem
    attr_reader :name, :version

    def initialize(name = 'Other', version = nil)
      @name = name
      @version = version
    end

    def to_s
      string = name
      unless version.nil?
        string += " #{version}"
      end
      string
    end

    def inspect
      "#<#{self.class} #{to_s}>"
    end

    def eql?(other)
      self.class.eql?(other.class) &&
        name == other.name &&
        version == other.version
    end

    alias_method :==, :eql?
  end
end