geom2d 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 043eb93cd10b8d15d014db835f2ecaed3ec495a600b9c59dcb10f86335ceb22e
4
- data.tar.gz: 97dfa82e0c56cb6e2a02dc3d9e3b2df2a8402ee9923cc7caf13ee75927a71e41
3
+ metadata.gz: 566a729098db9e6e287e5fb5364b918d820db141e0e0e12bac8759bd30c92e1d
4
+ data.tar.gz: 62975caab4acd95dc2cd57ae004230874946da46d1b5900cb2dda5495a429d08
5
5
  SHA512:
6
- metadata.gz: e507dc3dab4bb5cc4b47e7067a74c89fa11622fa98aefb204a9953d8a2bb84b36caac9e810276723f086b01f6a921de7a99290f5f85d04bc965e6017d56bf8cb
7
- data.tar.gz: daab0a906fa57068d9444c004ac06839fcb2fa1935c08042d8364e68bb79c23051df440e1cde2600e9ac8be939fb9caf3ba68fc7fe529b98588e27be2f4263cc
6
+ metadata.gz: f2640002490e04141f3dc4fe786547401d7a0378be876ec802c4fcd52e13e2c5977eb7573ab4e02aea458cf4d83cded5d187303fc476a5ad410530199fdf89fc
7
+ data.tar.gz: 0c69283eb233f21538bdc2ab7d5151d4fb88687bee6f1aee59271b410fa5be4ac1ecb9394945660296ed7b7b7e7130d80d5a442056c82a202b8488aaeb9910e2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.4.1 - 2023-07-31
2
+
3
+ ### Added
4
+
5
+ * Methods `#to_ary` and `#to_a` for Geom2D::Rectangle
6
+
7
+
1
8
  ## 0.4.0 - 2023-07-31
2
9
 
3
10
  ### Added
data/CONTRIBUTERS CHANGED
@@ -1,3 +1,3 @@
1
1
  Count Name
2
2
  ======= ====
3
- 26 Thomas Leitner <t_leitner@gmx.at>
3
+ 28 Thomas Leitner <t_leitner@gmx.at>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -87,6 +87,12 @@ module Geom2D
87
87
  end
88
88
  alias to_s inspect
89
89
 
90
+ # Returns an array with the vertices of the rectangle.
91
+ def to_ary
92
+ vertices
93
+ end
94
+ alias to_a to_ary
95
+
90
96
  private
91
97
 
92
98
  # Returns an array with the four corners of the rectangle.
@@ -11,6 +11,6 @@
11
11
  module Geom2D
12
12
 
13
13
  # The version of Geom2D
14
- VERSION = '0.4.0'
14
+ VERSION = '0.4.1'
15
15
 
16
16
  end
@@ -41,6 +41,10 @@ describe Geom2D::Rectangle do
41
41
  assert(@rectangle.ccw?)
42
42
  end
43
43
 
44
+ it "returns the vertices when asked to be converted to an array" do
45
+ assert_equal([[10, 20], [110, 20], [110, 70], [10, 70]], @rectangle.to_ary)
46
+ end
47
+
44
48
  it "returns a useful inspection string" do
45
49
  assert_equal("Rectangle[(10,20),width=100,height=50]", @rectangle.inspect)
46
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geom2d
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner