Class Ym4r::GmPlugin::GBounds
In: lib/gm_plugin/point.rb
Parent: Object

A rectangular that contains all the pixel points passed as arguments

Methods

create   new  

Included Modules

MappingObject

Attributes

points  [RW] 

Public Class methods

Accepts both an array of GPoint and an array of 2-element arrays

[Source]

    # File lib/gm_plugin/point.rb, line 15
15:       def initialize(points)
16:         if !points.empty? and points[0].is_a?(Array)
17:           @points = points.collect { |pt| GPoint.new(pt[0],pt[1]) }
18:         else
19:           @points = points
20:         end
21:       end

Public Instance methods

[Source]

    # File lib/gm_plugin/point.rb, line 22
22:       def create
23:         "new GBounds([#{@points.map { |pt| pt.to_javascript}.join(",")}])"
24:       end

[Validate]