Class: Svg::Line
Instance Attribute Summary collapse
-
#from_x ⇒ Object
Returns the value of attribute from_x.
-
#from_y ⇒ Object
Returns the value of attribute from_y.
-
#to_x ⇒ Object
Returns the value of attribute to_x.
-
#to_y ⇒ Object
Returns the value of attribute to_y.
Attributes inherited from Feature
#fill, #fill_opacity, #stroke, #stroke_opacity, #stroke_width, #style
Instance Method Summary collapse
Methods inherited from Feature
Instance Attribute Details
#from_x ⇒ Object
Returns the value of attribute from_x.
120 121 122 |
# File 'lib/svg.rb', line 120 def from_x @from_x end |
#from_y ⇒ Object
Returns the value of attribute from_y.
120 121 122 |
# File 'lib/svg.rb', line 120 def from_y @from_y end |
#to_x ⇒ Object
Returns the value of attribute to_x.
120 121 122 |
# File 'lib/svg.rb', line 120 def to_x @to_x end |
#to_y ⇒ Object
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_svg ⇒ Object
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 |