Class: Weechat::Color
- Inherits:
-
Object
- Object
- Weechat::Color
- Defined in:
- lib/weechat/color.rb
Overview
This class represents a Weechat color.
It is created from a color name and saves that name and the color representation.
Instance Attribute Summary collapse
-
#color ⇒ Object
(also: #to_s, #to_str)
readonly
Returns the value of attribute color.
- #name ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name) ⇒ Color
constructor
A new instance of Color.
- #to_weechat_config ⇒ Object
Constructor Details
#initialize(name) ⇒ Color
Returns a new instance of Color.
18 19 20 |
# File 'lib/weechat/color.rb', line 18 def initialize(name) @name = name end |
Instance Attribute Details
#color ⇒ Object (readonly) Also known as: to_s, to_str
Returns the value of attribute color.
17 18 19 |
# File 'lib/weechat/color.rb', line 17 def color @color end |
#name ⇒ Object (readonly)
16 17 18 |
# File 'lib/weechat/color.rb', line 16 def name @name end |
Class Method Details
.const_missing(c) ⇒ Object
11 12 13 |
# File 'lib/weechat/color.rb', line 11 def self.const_missing(c) self.new(c.to_s.downcase) end |
.from_weechat_config(v) ⇒ Object
7 8 9 |
# File 'lib/weechat/color.rb', line 7 def self.from_weechat_config(v) new(v) end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 |
# File 'lib/weechat/color.rb', line 32 def ==(other) @name == other.name end |
#to_weechat_config ⇒ Object
28 29 30 |
# File 'lib/weechat/color.rb', line 28 def to_weechat_config @name end |