Class: Color::RGB::JP::Base::NamedRGB
- Inherits:
-
Object
- Object
- Color::RGB::JP::Base::NamedRGB
- Defined in:
- lib/color/rgb/jp/base/named_rgb.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rgb ⇒ Object
readonly
Returns the value of attribute rgb.
Instance Method Summary collapse
-
#initialize(name, rgb) ⇒ NamedRGB
constructor
A new instance of NamedRGB.
- #to_s ⇒ Object
Constructor Details
#initialize(name, rgb) ⇒ NamedRGB
Returns a new instance of NamedRGB.
5 6 7 8 |
# File 'lib/color/rgb/jp/base/named_rgb.rb', line 5 def initialize(name, rgb) @name = name @rgb = rgb end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/color/rgb/jp/base/named_rgb.rb', line 4 def name @name end |
#rgb ⇒ Object (readonly)
Returns the value of attribute rgb.
4 5 6 |
# File 'lib/color/rgb/jp/base/named_rgb.rb', line 4 def rgb @rgb end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/color/rgb/jp/base/named_rgb.rb', line 10 def to_s "%s (%s)" % [name.romaji, rgb.html] end |