Class: Fixnum

Inherits:
Object show all
Defined in:
lib/multiarray/rgb.rb

Instance Method Summary collapse

Instance Method Details

#power_with_rgb(other) ⇒ Object

** is modified to work with RGB values

Parameters:

  • other (Object)

    Second operand for binary operation.

Returns:

  • (Object)

    Result of binary operation.



923
924
925
926
927
928
929
930
# File 'lib/multiarray/rgb.rb', line 923

def power_with_rgb(other)
  if other.is_a? Hornetseye::RGB
    x, y = other.coerce self
    x ** y
  else
    power_without_rgb other
  end
end