Class: Svg::Feature

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

Direct Known Subclasses

Circle, Ellipse, Line, Rectangle

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fillObject

Returns the value of attribute fill.



49
50
51
# File 'lib/svg.rb', line 49

def fill
  @fill
end

#fill_opacityObject

Returns the value of attribute fill_opacity.



49
50
51
# File 'lib/svg.rb', line 49

def fill_opacity
  @fill_opacity
end

#strokeObject

Returns the value of attribute stroke.



49
50
51
# File 'lib/svg.rb', line 49

def stroke
  @stroke
end

#stroke_opacityObject

Returns the value of attribute stroke_opacity.



49
50
51
# File 'lib/svg.rb', line 49

def stroke_opacity
  @stroke_opacity
end

#stroke_widthObject

Returns the value of attribute stroke_width.



49
50
51
# File 'lib/svg.rb', line 49

def stroke_width
  @stroke_width
end

#styleObject

Returns the value of attribute style.



49
50
51
# File 'lib/svg.rb', line 49

def style
  @style
end

Instance Method Details

#attr_to_s(attr_name, attr_val) ⇒ Object



54
55
56
57
# File 'lib/svg.rb', line 54

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



59
60
61
62
63
# File 'lib/svg.rb', line 59

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_svgObject



50
51
52
# File 'lib/svg.rb', line 50

def to_svg
  '<overrideme/>'
end