class RGB
Attributes
b[R]
g[R]
r[R]
Public Class Methods
new(array)
click to toggle source
# File lib/rgbify.rb, line 4 def initialize(array) @r = array[0] @g = array[1] @b = array[2] end
Public Instance Methods
[](int)
click to toggle source
# File lib/rgbify.rb, line 10 def [](int) case int when 0 @r when 1 @g when 2 @b else raise "Out of bounds" end end