Sha256: 1fe67f02740585b3a7c975c27bc0d109ca9a57ea03b33a418d9d2d9266ff945d

Contents?: true

Size: 393 Bytes

Versions: 4

Compression:

Stored size: 393 Bytes

Contents

module UserAgentParser
  class Device
    attr_reader :family

    alias_method :name, :family

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

    def to_s
      family
    end

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

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

    alias_method :==, :eql?
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
user_agent_parser-2.3.2 lib/user_agent_parser/device.rb
user_agent_parser-2.3.1 lib/user_agent_parser/device.rb
user_agent_parser-2.3.0 lib/user_agent_parser/device.rb
user_agent_parser-2.2.0 lib/user_agent_parser/device.rb