Sha256: 12a1b02005f0e4eed79a443a5ce8b239b7dbf658ed6986e7cf00e3dcd67a9620
Contents?: true
Size: 642 Bytes
Versions: 39
Compression:
Stored size: 642 Bytes
Contents
module GridGenerator class BaseElement def initialize(points:, colour: , opacity: 1) @points = points @colour = colour @opacity = opacity end attr_reader :points, :colour, :opacity def ==(other) self.class == other.class && self.points == other.points && self.colour == other.colour && self.opacity == other.opacity end def points_string points.map { |p| "#{p[0,0].round},#{p[1,0].round}" }.join(' ') end def as_json { "points_string" => points_string, "colour" => colour, "opacity" => opacity } end end end
Version data entries
39 entries across 39 versions & 1 rubygems