Class: ZPNG::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.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/zpng/pixels.rb', line 40 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
52 53 54 |
# File 'lib/zpng/pixels.rb', line 52 def == other self.to_a == other.to_a end |
#uniq ⇒ Object
56 57 58 |
# File 'lib/zpng/pixels.rb', line 56 def uniq self.to_a.uniq end |