You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,10 +45,9 @@ lazy["hello"][1].value # => 2 (constant-time after first access)
45
45
46
46
## 📖 Usage Guide
47
47
48
-
### CBOR::Lazy – Zero-Copy On-Demand Access
48
+
### CBOR::Lazy – On-Demand Access
49
49
50
50
`decode_lazy` returns a `CBOR::Lazy` object wrapping the raw buffer **without decoding**. Navigate with `[]` or `dig`, then call `.value` when you need the actual value.
-`CBOR::Type::Tagged` (for Bigint, your own registered Tags)
149
144
-`CBOR::Type::Simple` (nil, false, true, Floats)
150
145
151
-
Convience Types
146
+
Convenience Types:
152
147
-`CBOR::Type::BytesOrString`
153
148
-`CBOR::Type::Integer`
154
149
@@ -157,32 +152,48 @@ Convience Types
157
152
### Symbol Handling
158
153
159
154
Three strategies for encoding Ruby symbols:
160
-
161
155
```ruby
162
-
# 1. Default: convert to strings
163
-
CBOR.symbols_as_strings
156
+
# 1. Default: convert to strings (no tag)
157
+
CBOR.no_symbols
158
+
159
+
# 2. Use tag 39 + string
160
+
CBOR.symbols_as_string
164
161
165
-
#2. Use tag 39 + uint32 (mruby-to-mruby only)
162
+
#3. Use tag 39 + uint32 (mruby-to-mruby only)
166
163
CBOR.symbols_as_uint32
167
164
sym =:hello
168
165
encoded =CBOR.encode(sym)
169
166
decoded =CBOR.decode(encoded) # => :hello
170
167
```
171
168
172
-
> **⚠️ Warning:** Symbol as uint32 are mruby instance–specific. Only use `symbols_as_uint32` when both encoder and decoder run on the same mruby executable and when all symbols are interned at compile time, see https://github.com/mruby/mruby/blob/master/doc/guides/symbol.md#preallocate-symbols
169
+
> **⚠️ Warning:**`symbols_as_uint32` is mruby instance–specific. Only use it when both encoder and decoder run on the same mruby executable and when all symbols are interned at compile time, see https://github.com/mruby/mruby/blob/master/doc/guides/symbol.md#preallocate-symbols
170
+
171
+
---
172
+
173
+
### Streaming
174
+
175
+
Read a sequence of CBOR documents from any IO-like object:
0 commit comments