Class: UserAgentParser::Device
- Inherits:
-
Object
- Object
- UserAgentParser::Device
- Defined in:
- lib/user_agent_parser/device.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(name = nil) ⇒ Device
constructor
A new instance of Device.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ Device
Returns a new instance of Device.
5 6 7 |
# File 'lib/user_agent_parser/device.rb', line 5 def initialize(name = nil) @name = name || 'Other' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/user_agent_parser/device.rb', line 3 def name @name end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
17 18 19 |
# File 'lib/user_agent_parser/device.rb', line 17 def eql?(other) self.class.eql?(other.class) && name == other.name end |
#inspect ⇒ Object
13 14 15 |
# File 'lib/user_agent_parser/device.rb', line 13 def inspect "#<#{self.class} #{to_s}>" end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/user_agent_parser/device.rb', line 9 def to_s name end |