Class: Color::RGB::JP::Base::NamedRGB

Inherits:
Object
  • Object
show all
Defined in:
lib/color/rgb/jp/base/named_rgb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#rgbObject (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_sObject



10
11
12
# File 'lib/color/rgb/jp/base/named_rgb.rb', line 10

def to_s
  "%s (%s)" % [name.romaji, rgb.html]
end