Sha256: c9373cbce5fb19ae077cc07a62f2ec6cd09a645c2edf9d48d52d2a00dcec52e9

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

module UserAgentParser

  class UserAgent

    attr_accessor :family, :version, :os

    def initialize(family="Other", version=nil, os=nil)
      self.family = family
      self.version = version
      self.os = os
    end

    def to_s
      s = family
      s += " #{version}" if version
      s
    end

    def inspect
      "#<#{self.class} #{to_s}>"
    end
    
    def ==(other)
      family == other.family &&
        version == other.version &&
        os == other.os
    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
user_agent_parser-1.0.0 lib/user_agent_parser/user_agent.rb