Class: GridGenerator::Svg::Style
- Inherits:
-
Object
- Object
- GridGenerator::Svg::Style
- Defined in:
- lib/grid_generator/svg/style.rb
Instance Attribute Summary collapse
-
#fill ⇒ Object
readonly
Returns the value of attribute fill.
-
#opacity ⇒ Object
readonly
Returns the value of attribute opacity.
-
#stroke ⇒ Object
readonly
Returns the value of attribute stroke.
-
#stroke_width ⇒ Object
readonly
Returns the value of attribute stroke_width.
Instance Method Summary collapse
-
#initialize(fill:, stroke: '#404040', stroke_width: 1, opacity: 1) ⇒ Style
constructor
A new instance of Style.
- #to_s ⇒ Object
Constructor Details
#initialize(fill:, stroke: '#404040', stroke_width: 1, opacity: 1) ⇒ Style
Returns a new instance of Style.
4 5 6 7 8 9 |
# File 'lib/grid_generator/svg/style.rb', line 4 def initialize(fill: , stroke: '#404040', stroke_width: 1, opacity: 1) @fill = fill @stroke = stroke @stroke_width = stroke_width @opacity = opacity end |
Instance Attribute Details
#fill ⇒ Object (readonly)
Returns the value of attribute fill.
11 12 13 |
# File 'lib/grid_generator/svg/style.rb', line 11 def fill @fill end |
#opacity ⇒ Object (readonly)
Returns the value of attribute opacity.
11 12 13 |
# File 'lib/grid_generator/svg/style.rb', line 11 def opacity @opacity end |
#stroke ⇒ Object (readonly)
Returns the value of attribute stroke.
11 12 13 |
# File 'lib/grid_generator/svg/style.rb', line 11 def stroke @stroke end |
#stroke_width ⇒ Object (readonly)
Returns the value of attribute stroke_width.
11 12 13 |
# File 'lib/grid_generator/svg/style.rb', line 11 def stroke_width @stroke_width end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/grid_generator/svg/style.rb', line 13 def to_s "fill:#{fill};stroke:#{stroke};stroke-width:#{stroke_width};opacity:#{opacity};" end |