Class: Rszr::Fill
- Inherits:
-
Object
- Object
- Rszr::Fill
- Defined in:
- lib/rszr/fill.rb
Instance Attribute Summary collapse
-
#angle ⇒ Object
readonly
Returns the value of attribute angle.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#gradient ⇒ Object
readonly
Returns the value of attribute gradient.
Instance Method Summary collapse
-
#initialize(color: nil, gradient: nil, angle: 0) ⇒ Fill
constructor
A new instance of Fill.
- #to_fill ⇒ Object
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
#angle ⇒ Object (readonly)
Returns the value of attribute angle.
3 4 5 |
# File 'lib/rszr/fill.rb', line 3 def angle @angle end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
3 4 5 |
# File 'lib/rszr/fill.rb', line 3 def color @color end |
#gradient ⇒ Object (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_fill ⇒ Object
16 17 18 |
# File 'lib/rszr/fill.rb', line 16 def to_fill(*) self end |