Class: Libnotify::IconFinder::Icon
- Inherits:
-
Object
- Object
- Libnotify::IconFinder::Icon
- Defined in:
- lib/libnotify/icon_finder.rb
Constant Summary collapse
- ICON_REGEX =
/(\d+)x\d+/
Instance Attribute Summary collapse
-
#fullpath ⇒ Object
readonly
Returns the value of attribute fullpath.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(fullpath) ⇒ Icon
constructor
A new instance of Icon.
- #resolution ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(fullpath) ⇒ Icon
Returns a new instance of Icon.
20 21 22 |
# File 'lib/libnotify/icon_finder.rb', line 20 def initialize(fullpath) @fullpath = fullpath end |
Instance Attribute Details
#fullpath ⇒ Object (readonly)
Returns the value of attribute fullpath.
18 19 20 |
# File 'lib/libnotify/icon_finder.rb', line 18 def fullpath @fullpath end |
Instance Method Details
#<=>(other) ⇒ Object
33 34 35 36 37 |
# File 'lib/libnotify/icon_finder.rb', line 33 def <=>(other) result = other.resolution <=> self.resolution result = self.fullpath <=> other.fullpath if result == 0 result end |
#resolution ⇒ Object
25 26 27 |
# File 'lib/libnotify/icon_finder.rb', line 25 def resolution @resolution ||= @fullpath[ICON_REGEX, 1].to_i end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/libnotify/icon_finder.rb', line 29 def to_s fullpath end |