Class: UserAgentParser::Device

Inherits:
Object
  • Object
show all
Defined in:
lib/user_agent_parser/device.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(family = nil) ⇒ Device

Returns a new instance of Device.



7
8
9
# File 'lib/user_agent_parser/device.rb', line 7

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

Instance Attribute Details

#familyObject (readonly) Also known as: name

Returns the value of attribute family.



3
4
5
# File 'lib/user_agent_parser/device.rb', line 3

def family
  @family
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


19
20
21
# File 'lib/user_agent_parser/device.rb', line 19

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

#inspectObject



15
16
17
# File 'lib/user_agent_parser/device.rb', line 15

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

#to_sObject



11
12
13
# File 'lib/user_agent_parser/device.rb', line 11

def to_s
  family
end