Class: UserAgentParser::Device
- Inherits:
-
Object
- Object
- UserAgentParser::Device
- Defined in:
- lib/user_agent_parser/device.rb
Instance Attribute Summary collapse
-
#family ⇒ Object
(also: #name)
readonly
Returns the value of attribute family.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(family = nil) ⇒ Device
constructor
A new instance of Device.
- #inspect ⇒ Object
- #to_s ⇒ Object
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
#family ⇒ Object (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: ==
19 20 21 |
# File 'lib/user_agent_parser/device.rb', line 19 def eql?(other) self.class.eql?(other.class) && family == other.family end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/user_agent_parser/device.rb', line 15 def inspect "#<#{self.class} #{to_s}>" end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/user_agent_parser/device.rb', line 11 def to_s family end |