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, #point_to_s

Instance Attribute Details

#fromObject

Returns the value of attribute from.



128
129
130
# File 'lib/svg.rb', line 128

def from
  @from
end

#toObject

Returns the value of attribute to.



128
129
130
# File 'lib/svg.rb', line 128

def to
  @to
end

Instance Method Details

#to_svgObject



129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/svg.rb', line 129

def to_svg
  string_val = "<line"
  string_val += point_to_s 'x1', 'y1', from
  string_val += point_to_s 'x2', 'y2', to

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

  return string_val
end