Sha256: 3c41a1aede7753a0409737a385b5804dacbae14dca704410f1c3ffd50b765622
Contents?: true
Size: 532 Bytes
Versions: 7
Compression:
Stored size: 532 Bytes
Contents
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
Version data entries
7 entries across 7 versions & 1 rubygems