Class: Rszr::Fill

Inherits:
Object
  • Object
show all
Defined in:
lib/rszr/fill.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color: nil, gradient: nil, angle: 0) ⇒ Fill



5
6
7
8
9
10
11
12
13
14
# File 'lib/rszr/fill.rb', line 5

def initialize(color: nil, gradient: nil, angle: 0)
  if gradient
    @gradient = gradient
    @angle = angle || 0
  elsif color
    @color = color
  else
    raise ArgumentError, 'incomplete fill definition'
  end
end

Instance Attribute Details

#angleObject (readonly)

Returns the value of attribute angle.



3
4
5
# File 'lib/rszr/fill.rb', line 3

def angle
  @angle
end

#colorObject (readonly)

Returns the value of attribute color.



3
4
5
# File 'lib/rszr/fill.rb', line 3

def color
  @color
end

#gradientObject (readonly)

Returns the value of attribute gradient.



3
4
5
# File 'lib/rszr/fill.rb', line 3

def gradient
  @gradient
end

Instance Method Details

#to_fillObject



16
17
18
# File 'lib/rszr/fill.rb', line 16

def to_fill(*)
  self
end