Class: Dominikh::DynamicIcon Abstract
- Inherits:
-
Subtlext::Icon
- Object
- Subtlext::Icon
- Dominikh::DynamicIcon
- Defined in:
- lib/subtle/dominikh/dynamic_icon.rb
Overview
This class is abstract.
Subclass and override #render to implement a dynamic
icon, e.g. a graph.
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize(width, height) ⇒ DynamicIcon
constructor
A new instance of DynamicIcon.
-
#render ⇒ void
Draws the icon.
-
#to_str ⇒ Object
(also: #to_s)
return [String].
Constructor Details
#initialize(width, height) ⇒ DynamicIcon
Returns a new instance of DynamicIcon.
9 10 11 12 |
# File 'lib/subtle/dominikh/dynamic_icon.rb', line 9 def initialize(width, height) super(width, height) @color = nil end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
7 8 9 |
# File 'lib/subtle/dominikh/dynamic_icon.rb', line 7 def color @color end |
Instance Method Details
#+(other) ⇒ Object
36 37 38 |
# File 'lib/subtle/dominikh/dynamic_icon.rb', line 36 def +(other) self.to_s + other end |
#render ⇒ void
This method returns an undefined value.
Draws the icon. Redefine this in subclasses to define custom drawing routines.
44 45 46 |
# File 'lib/subtle/dominikh/dynamic_icon.rb', line 44 def render clear end |
#to_str ⇒ Object Also known as: to_s
return [String]
26 27 28 29 30 31 32 33 |
# File 'lib/subtle/dominikh/dynamic_icon.rb', line 26 def to_str s = super if color return color + s + Subtlext::Subtle.colors[:fg_sublets].to_s else return s end end |