Sha256: 153859c8946c638d65c9d98384fb15c50e5158aca6b7c5bbacdec99fa80d84ee

Contents?: true

Size: 346 Bytes

Versions: 7

Compression:

Stored size: 346 Bytes

Contents

module UserAgentParser
  class Device
    attr_reader :name

    def initialize(name = nil)
      @name = name || 'Other'
    end

    def to_s
      name
    end

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

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

    alias_method :==, :eql?
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
user_agent_parser-2.1.5 lib/user_agent_parser/device.rb
user_agent_parser-2.1.4 lib/user_agent_parser/device.rb
user_agent_parser-2.1.3 lib/user_agent_parser/device.rb
user_agent_parser-2.1.2 lib/user_agent_parser/device.rb
user_agent_parser-2.1.1 lib/user_agent_parser/device.rb
user_agent_parser-2.1.0 lib/user_agent_parser/device.rb
user_agent_parser-2.0.0 lib/user_agent_parser/device.rb