Class: SVG::Polygon

Inherits:
ElementBase show all
Defined in:
lib/ruby-svg/element.rb

Overview

#

Polygon Class

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#attr, #class, #id, #style, #transform

Instance Method Summary collapse

Constructor Details

#initialize(points) ⇒ Polygon

Returns a new instance of Polygon.



242
243
244
245
# File 'lib/ruby-svg/element.rb', line 242

def initialize(points)
  super()
  @points = points
end

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



247
248
249
# File 'lib/ruby-svg/element.rb', line 247

def points
  @points
end

Instance Method Details

#to_sObject



249
250
251
252
253
254
# File 'lib/ruby-svg/element.rb', line 249

def to_s
  text = %|<polygon points="#{@points.join(' ')}"|
  text << super()
  text << %| />|
  return text
end