Class: Rainbow::OpacityRanges

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rainbow/opacity_ranges.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opacity_ranges, gradient) ⇒ OpacityRanges

Returns a new instance of OpacityRanges.



8
9
10
11
12
13
# File 'lib/rainbow/opacity_ranges.rb', line 8

def initialize(opacity_ranges, gradient)
  @ranges   = opacity_ranges
  @gradient = gradient

  @ranges.each { |range| range.gradient = gradient }
end

Instance Attribute Details

#current_xObject

Returns the value of attribute current_x.



6
7
8
# File 'lib/rainbow/opacity_ranges.rb', line 6

def current_x
  @current_x
end

#gradientObject (readonly)

Returns the value of attribute gradient.



6
7
8
# File 'lib/rainbow/opacity_ranges.rb', line 6

def gradient
  @gradient
end

#rangesObject (readonly)

Returns the value of attribute ranges.



6
7
8
# File 'lib/rainbow/opacity_ranges.rb', line 6

def ranges
  @ranges
end