Sha256: 89d74982bc7c2fae7d03b8b9e2d80008f2d04b7b7f4ddbfc6a0e1226244c5229

Contents?: true

Size: 445 Bytes

Versions: 21

Compression:

Stored size: 445 Bytes

Contents

module GridGenerator
  class BaseLine
    def initialize(x1:, y1:, x2:, y2:)
      @x1, @y1 = x1, y1
      @x2, @y2 = x2, y2
    end

    attr_reader :x1, :y1, :x2, :y2

    def ==(other)
      self.x1 == other.x1 &&
        self.y1 == other.y1 &&
        self.x2 == other.x2 &&
        self.y2 == other.y2
    end

    def as_json
      {
        "x1" => x1,
        "y1" => y1,
        "x2" => x2,
        "y2" => y2
      }
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
grid_generator-0.2.9 lib/grid_generator/base_line.rb
grid_generator-0.2.8 lib/grid_generator/base_line.rb
grid_generator-0.2.7 lib/grid_generator/base_line.rb
grid_generator-0.2.6 lib/grid_generator/base_line.rb
grid_generator-0.2.5 lib/grid_generator/base_line.rb
grid_generator-0.2.4 lib/grid_generator/base_line.rb
grid_generator-0.2.3 lib/grid_generator/base_line.rb
grid_generator-0.2.2 lib/grid_generator/base_line.rb
grid_generator-0.2.1 lib/grid_generator/base_line.rb
grid_generator-0.2.0 lib/grid_generator/base_line.rb
grid_generator-0.1.12 lib/grid_generator/base_line.rb
grid_generator-0.1.11 lib/grid_generator/base_line.rb
grid_generator-0.1.10 lib/grid_generator/base_line.rb
grid_generator-0.1.9 lib/grid_generator/base_line.rb
grid_generator-0.1.8 lib/grid_generator/base_line.rb
grid_generator-0.1.7 lib/grid_generator/base_line.rb
grid_generator-0.1.6 lib/grid_generator/base_line.rb
grid_generator-0.1.5 lib/grid_generator/base_line.rb
grid_generator-0.1.4 lib/grid_generator/base_line.rb
grid_generator-0.1.3 lib/grid_generator/base_line.rb