class GerbilCharts::SVGDC::SVGRect
SVGRect
- a simple rectangle¶ ↑
Attributes
h[RW]
w[RW]
x[RW]
y[RW]
Public Class Methods
new(x,y,w,h)
click to toggle source
x = x position y = y position w = width h = height
To create rectangle top left corner at (10,10) and width 200,height 100 do :
SVGRect.new (10,10,200,150)
Calls superclass method
# File lib/gerbilcharts/svgdc/svg_rect.rb, line 17 def initialize(x,y,w,h) @x,@y,@w,@h=x,y,w,h super() end
Public Instance Methods
render(xfrag)
click to toggle source
# File lib/gerbilcharts/svgdc/svg_rect.rb, line 22 def render(xfrag) h= { :x => @x, :y => @y, :width => @w, :height => @h } render_base(xfrag) { xfrag.rect( h.merge(render_attributes)) } end