qi 10.0.0.beta6 → 10.0.0.beta7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/qi.rb +16 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 638a4dafc9645e200d72d7799afb3f28cca3a81f7cd887e5f29c64974e5776e0
4
- data.tar.gz: 5e74a8a31f894187b404a3c41ed1a1434916880925934f2fe627e19472f99084
3
+ metadata.gz: e850bab495ea23b4c438ec54439eb4b4b0486d0b6d1afd23f9d9d870eca46e43
4
+ data.tar.gz: 0f0e3271857d1a513069416bcb246b439f3fb99b3f550a9a9f1e1bc15b286a35
5
5
  SHA512:
6
- metadata.gz: 41a6e8c87db922ca87d992b62909c6cf5d87d8900d12c9bc0b43d94d1882040d168678ee9d3f6be85904b7f275a0eaa9c42e32364b0d7c5e4766ec84953fdb10
7
- data.tar.gz: 14323df90b7e942fbae1a1db4f3e23f071c4fdd62bd969797a39909c710e599534c5eaa2fd4b6a01ffbe91f48d25122a28c32b599fc5731f9b3c14b72c2f8a74
6
+ metadata.gz: c94b483676c67796e208e2b354420c9fd20d0f286d2e3f4c6145a70945d61f601b8803af2ebed7bca964435881a27499a63f18151073f8bcf04126a65b265e2a
7
+ data.tar.gz: 62665dedc27de056316e923fcf5e6e604de42c399b00b2b015b5a2e44049fae9f05cee3a95d08aaaf655f77a54f1ae923ebcfe69ec373ba37657aa45bb656b52
data/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  Add this line to your application's Gemfile:
14
14
 
15
15
  ```ruby
16
- gem "qi", ">= 10.0.0.beta5"
16
+ gem "qi", ">= 10.0.0.beta7"
17
17
  ```
18
18
 
19
19
  And then execute:
data/lib/qi.rb CHANGED
@@ -69,6 +69,22 @@ class Qi
69
69
  ]
70
70
  end
71
71
 
72
+ # Returns a hash representation of the Qi object's attributes.
73
+ #
74
+ # @return [Hash{Symbol => Object}] a hash containing four key-value pairs:
75
+ # - is_north_turn: a boolean value indicating whose turn it is
76
+ # - north_captures: an array of pieces captured by the north player
77
+ # - south_captures: an array of pieces captured by the south player
78
+ # - squares: a hash of squares on the board
79
+ def to_h
80
+ {
81
+ is_north_turn: north_turn?,
82
+ north_captures:,
83
+ south_captures:,
84
+ squares:
85
+ }
86
+ end
87
+
72
88
  # Returns a string representation of the Qi object's attributes.
73
89
  #
74
90
  # @return [String] a string containing three parts separated by "===":
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qi
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0.beta6
4
+ version: 10.0.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-23 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An abstraction that could help to update positions for games like Shogi.
14
14
  email: contact@cyril.email