Class: CineSync::RGBArray
- Inherits:
-
Array
- Object
- Array
- CineSync::RGBArray
- Defined in:
- lib/cinesync/color_grading.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#[](key) ⇒ Object
Implements an array of three values (corresponding to red, green, and blue) that can be indexed by position or string-convertible object:
r,g,b = [0], [1], [2]
r,g,b = ['red'], [:green], [:b]
39 40 41 42 43 |
# File 'lib/cinesync/color_grading.rb', line 39 def [](key) index = index_for_key(key) fail "Unknown key used to index #{self.class}: #{key.inspect}" unless index self.at(index) end |
#[]=(key, value) ⇒ Object
45 46 47 48 49 |
# File 'lib/cinesync/color_grading.rb', line 45 def []=(key, value) index = index_for_key(key) fail "Unknown key used to index #{self.class}: #{key.inspect}" unless index super(index, value) end |