Class: Svg::Line

Inherits:
Feature show all
Defined in:
lib/svg.rb

Instance Attribute Summary collapse

Attributes inherited from Feature

#fill, #fill_opacity, #stroke, #stroke_opacity, #stroke_width, #style

Instance Method Summary collapse

Methods inherited from Feature

#attr_to_s

Instance Attribute Details

#from_xObject

Returns the value of attribute from_x.



120
121
122
# File 'lib/svg.rb', line 120

def from_x
  @from_x
end

#from_yObject

Returns the value of attribute from_y.



120
121
122
# File 'lib/svg.rb', line 120

def from_y
  @from_y
end

#to_xObject

Returns the value of attribute to_x.



120
121
122
# File 'lib/svg.rb', line 120

def to_x
  @to_x
end

#to_yObject

Returns the value of attribute to_y.



120
121
122
# File 'lib/svg.rb', line 120

def to_y
  @to_y
end

Instance Method Details

#to_svgObject



121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/svg.rb', line 121

def to_svg
  string_val = "<line"
  string_val += attr_to_s 'x1', from_x
  string_val += attr_to_s 'y1', from_y
  string_val += attr_to_s 'x2', to_x
  string_val += attr_to_s 'y2', to_y

  if not style.nil?
    string_val += " style=\"#{style.to_s}\""
  end
  string_val += "/>"

  return string_val
end