Sha256: 41c050d10df1d11e3f2c5a5d7a867c2e0f0e9ed3093c210c12e3d1a3c0b488cb
Contents?: true
Size: 641 Bytes
Versions: 15
Compression:
Stored size: 641 Bytes
Contents
# frozen_string_literal: true module UserAgentParser class Device DEFAULT_FAMILY = 'Other' attr_reader :family, :model, :brand alias name family def initialize(family = nil, model = nil, brand = nil) @family = family || DEFAULT_FAMILY @model = model || @family @brand = brand end def to_s family end def inspect "#<#{self.class} #{self}>" end def eql?(other) self.class.eql?(other.class) && family == other.family end alias == eql? def to_h { family: family, model: model, brand: brand } end end end
Version data entries
15 entries across 15 versions & 2 rubygems