Class: Svg::Feature
- Inherits:
-
Object
- Object
- Svg::Feature
- Defined in:
- lib/svg.rb
Instance Attribute Summary collapse
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#fill_opacity ⇒ Object
Returns the value of attribute fill_opacity.
-
#stroke ⇒ Object
Returns the value of attribute stroke.
-
#stroke_opacity ⇒ Object
Returns the value of attribute stroke_opacity.
-
#stroke_width ⇒ Object
Returns the value of attribute stroke_width.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
- #attr_to_s(attr_name, attr_val) ⇒ Object
- #point_to_s(x_attr_name, y_attr_name, point) ⇒ Object
- #to_svg ⇒ Object
Instance Attribute Details
#fill ⇒ Object
Returns the value of attribute fill.
3 4 5 |
# File 'lib/svg.rb', line 3 def fill @fill end |
#fill_opacity ⇒ Object
Returns the value of attribute fill_opacity.
3 4 5 |
# File 'lib/svg.rb', line 3 def fill_opacity @fill_opacity end |
#stroke ⇒ Object
Returns the value of attribute stroke.
3 4 5 |
# File 'lib/svg.rb', line 3 def stroke @stroke end |
#stroke_opacity ⇒ Object
Returns the value of attribute stroke_opacity.
3 4 5 |
# File 'lib/svg.rb', line 3 def stroke_opacity @stroke_opacity end |
#stroke_width ⇒ Object
Returns the value of attribute stroke_width.
3 4 5 |
# File 'lib/svg.rb', line 3 def stroke_width @stroke_width end |
#style ⇒ Object
Returns the value of attribute style.
3 4 5 |
# File 'lib/svg.rb', line 3 def style @style end |
Instance Method Details
#attr_to_s(attr_name, attr_val) ⇒ Object
8 9 10 11 |
# File 'lib/svg.rb', line 8 def attr_to_s (attr_name, attr_val) return '' if attr_val.nil? " #{attr_name}=\"#{attr_val}\"" if not attr_val.to_s.empty? end |
#point_to_s(x_attr_name, y_attr_name, point) ⇒ Object
13 14 15 16 17 |
# File 'lib/svg.rb', line 13 def point_to_s (x_attr_name, y_attr_name, point) return '' if point.nil? return_val = " #{x_attr_name}=\"#{point.x}\"" if not point.x.to_s.empty? return_val + " #{y_attr_name}=\"#{point.y}\"" if not point.y.to_s.empty? end |
#to_svg ⇒ Object
4 5 6 |
# File 'lib/svg.rb', line 4 def to_svg '<overrideme/>' end |