Skip to content

Commit

Permalink
README, src: Migrate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw committed Jun 24, 2019
1 parent 1636be4 commit f6e8411
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -29,6 +29,16 @@ Crystal bindings for [libcbor](https://github.com/PJK/libcbor).

```crystal
require "CBOR"
# Note: These print binary data!
puts -1.to_cbor
puts nil.to_cbor
puts true.to_cbor
puts 3.14.to_cbor
puts "abc".to_cbor
puts [1, 2, 3, "four"].to_cbor
puts Hash{"key" => "value"}.to_cbor
puts Time.now.to_cbor
```

CBOR.cr does not currently provide a mapping-style API, like the core JSON or YAML modules.
Expand Down
9 changes: 0 additions & 9 deletions src/CBOR.cr
Expand Up @@ -9,12 +9,3 @@ module CBOR
yield builder
end
end

# puts -1.to_cbor.to_slice.hexstring
# puts nil.to_cbor.to_slice.hexstring
# puts true.to_cbor.to_slice.hexstring
# puts 3.14.to_cbor.to_slice.hexstring
# puts "abc".to_cbor.to_slice.hexstring
# puts [1, 2, 3, "four"].to_cbor.to_slice.hexstring
# puts Hash{"key" => "value"}.to_cbor.to_slice.hexstring
# puts Time.now.to_cbor.to_slice.hexstring

0 comments on commit f6e8411

Please sign in to comment.