jsof 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16b2b1eca2132ec71666bc2829f2b7cfd5581f3c78b3e953510a6779bce577bc
4
- data.tar.gz: b46bf4cddbfda267939d815b236d3e6dc72af172764b90f53568cf3101898aa4
3
+ metadata.gz: 8beffa715163e87ac869b1e79d85dd69e346499794e27937a5b8d87fcb091e8c
4
+ data.tar.gz: 7195f8bfdf7fecef09875857424be7eea9248089aac202e8776431772a92f1a7
5
5
  SHA512:
6
- metadata.gz: 3868a8bdffe224d6d6605f845effee808c460efe125412f0a46b6b8677b54088a8912bfc72e9824577efab74d78b6fe0fdfc199fd6c9bc591f08404e62ba1fe0
7
- data.tar.gz: c559534816102c21b7fc7b5b2b8d4d9091cf26615f9626ce8d5f172be5cb4aec1d29b4781bb03ac0ea90c42b92ca8d0a44f682300b163400ba61f9cd3a4d34e2
6
+ metadata.gz: 20b1ffe4662b251a7004b765ecf0cbb05c13906d5160a721471096d341efc8a28406c965000b22a2068f1ae3288e7c36d051bfa97b583dc3c74429cccd88cbb7
7
+ data.tar.gz: a4463672330f071db3cda5d3634818ad96f175ebaef49425ce95304110d02ccccc9a8f302b2d5879b84f754da4aefa535ea71a40119f7ba03872853a28156f7d
data/README.md CHANGED
@@ -59,7 +59,7 @@ Also, you can define nested structure with type.
59
59
 
60
60
  ```ruby
61
61
  class Y < Jsof::WrapObject
62
- define_attr :xx, type: X
62
+ define_attr :x, type: X
63
63
  end
64
64
 
65
65
  y = Y.new
data/lib/jsof/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jsof
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -117,6 +117,29 @@ class Jsof::WrapObject
117
117
  @internal_object[internal_key] = Jsof::WrapHelper.unboxing(val)
118
118
  end
119
119
 
120
+ def each_pair(&block)
121
+ return enum_for(:each_pair) unless block
122
+ internal_object.each_key do |key|
123
+ block.call(key, self[key])
124
+ end
125
+ end
126
+
127
+ def each_key(&block)
128
+ return enum_for(:each_key) unless block
129
+ return internal_object.each_key(&block)
130
+ end
131
+
132
+ def each_value(&block)
133
+ return enum_for(:each_value) unless block
134
+ internal_object.each_key do |key|
135
+ block.call(self[key])
136
+ end
137
+ end
138
+
139
+ def key?(key)
140
+ return internal_object.key?(key.to_sym) || internal_object.key?(key.to_s)
141
+ end
142
+
120
143
  # Clean internal cache.
121
144
  # Call this after you changed wrapped object directly.
122
145
  def clear_internal
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riki Ishikawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-25 00:00:00.000000000 Z
11
+ date: 2022-04-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: