class UserAgentParser::OperatingSystem

Constants

DEFAULT_FAMILY

Attributes

family[R]
name[R]
version[R]

Public Class Methods

new(family = DEFAULT_FAMILY, version = nil) click to toggle source
# File lib/user_agent_parser/operating_system.rb, line 11
def initialize(family = DEFAULT_FAMILY, version = nil)
  @family = family
  @version = version
end

Public Instance Methods

==(other)
Alias for: eql?
eql?(other) click to toggle source
# File lib/user_agent_parser/operating_system.rb, line 26
def eql?(other)
  self.class.eql?(other.class) &&
    family == other.family &&
    version == other.version
end
Also aliased as: ==
inspect() click to toggle source
# File lib/user_agent_parser/operating_system.rb, line 22
def inspect
  "#<#{self.class} #{self}>"
end
to_h() click to toggle source
# File lib/user_agent_parser/operating_system.rb, line 34
def to_h
  {
    version: version.to_h,
    family: family
  }
end
to_s() click to toggle source
# File lib/user_agent_parser/operating_system.rb, line 16
def to_s
  string = family
  string += " #{version}" unless version.nil?
  string
end