Class: Color::RGB
- Inherits:
-
Object
- Object
- Color::RGB
- Defined in:
- lib/mc_dot_art_maker/extern_lib_extension.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Add to check equality.
-
#eql?(other) ⇒ Boolean
Add to use this object for hash key.
- #hash ⇒ Object
Instance Method Details
#==(other) ⇒ Object
Add to check equality
19 20 21 |
# File 'lib/mc_dot_art_maker/extern_lib_extension.rb', line 19 def ==(other) @r == other.r && @g == other.g && @b == other.b end |
#eql?(other) ⇒ Boolean
Add to use this object for hash key
23 24 25 |
# File 'lib/mc_dot_art_maker/extern_lib_extension.rb', line 23 def eql?(other) @r.eql?(other.r) && @g.eql?(other.g) && @b.eql?(other.b) end |
#hash ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/mc_dot_art_maker/extern_lib_extension.rb', line 26 def hash code = 17 code = 37*code + @r.hash code = 37*code + @g.hash code = 37*code + @b.hash code end |