Class: ZIMG::Pixels
Defined Under Namespace
Modules: ImageEnum, ScanLineEnum
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(x) ⇒ Pixels
constructor
A new instance of Pixels.
- #uniq ⇒ Object
Constructor Details
#initialize(x) ⇒ Pixels
Returns a new instance of Pixels.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/zimg/pixels.rb', line 42 def initialize(x) case x when Image @image = x extend ImageEnum when ScanLine @scanline = x extend ScanLineEnum else raise ArgumentError, "don't know how to enumerate #{x.inspect}" end end |
Instance Method Details
#==(other) ⇒ Object
54 55 56 |
# File 'lib/zimg/pixels.rb', line 54 def ==(other) to_a == other.to_a end |
#uniq ⇒ Object
58 59 60 |
# File 'lib/zimg/pixels.rb', line 58 def uniq to_a.uniq end |