Skip to content

Commit

Permalink
Fix a few YARD example rendering issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonsilva committed Nov 20, 2023
1 parent 8bc6b84 commit c064a8d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 23 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.1/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Fixed YARD example rendering issues in `InvalidKeyFormatError#initialize`, `InvalidKeyLengthError#initialize`,
`InvalidKeyTypeError#initialize`, `Event#initialize`, `EncryptedDirectMessage#initialize` and `Filter#to_h`

## [0.5.0] 2023-11-20

### Added
Expand Down Expand Up @@ -82,6 +89,7 @@ principles of immutability and was a major source of internal complexity as I ne

- Initial release

[unreleased]: https://github.com/wilsonsilva/nostr/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/wilsonsilva/nostr/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/wilsonsilva/nostr/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/wilsonsilva/nostr/compare/v0.2.0...v0.3.0
Expand Down
2 changes: 1 addition & 1 deletion lib/nostr/errors/invalid_key_format_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class InvalidKeyFormatError < KeyValidationError
# Initializes the error
#
# @example
# InvalidKeyFormatError.new('private'')
# InvalidKeyFormatError.new('private')
#
# @param [String] key_kind The kind of key that is invalid (public or private)
#
Expand Down
2 changes: 1 addition & 1 deletion lib/nostr/errors/invalid_key_length_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class InvalidKeyLengthError < KeyValidationError
# Initializes the error
#
# @example
# InvalidKeyLengthError.new('private'')
# InvalidKeyLengthError.new('private')
#
# @param [String] key_kind The kind of key that is invalid (public or private)
#
Expand Down
2 changes: 1 addition & 1 deletion lib/nostr/errors/invalid_key_type_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class InvalidKeyTypeError < KeyValidationError
# Initializes the error
#
# @example
# InvalidKeyTypeError.new('private'')
# InvalidKeyTypeError.new('private')
#
# @param [String] key_kind The kind of key that is invalid (public or private)
#
Expand Down
18 changes: 9 additions & 9 deletions lib/nostr/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ class Event
#
# @example Instantiating a new event
# Nostr::Event.new(
# id: 'ccf9fdf3e1466d7c20969c71ec98defcf5f54aee088513e1b73ccb7bd770d460',
# pubkey: '48df4af6e240ac5f7c5de89bf5941b249880be0e87d03685b178ccb1a315f52e',
# created_at: 1230981305,
# kind: 1,
# tags: [],
# content: 'Your feedback is appreciated, now pay $8',
# sig: '123ac2923b792ce730b3da34f16155470ab13c8f97f9c53eaeb334f1fb3a5dc9a7f643
# 937c6d6e9855477638f5655c5d89c9aa5501ea9b578a66aced4f1cd7b3'
# )
# id: 'ccf9fdf3e1466d7c20969c71ec98defcf5f54aee088513e1b73ccb7bd770d460',
# pubkey: '48df4af6e240ac5f7c5de89bf5941b249880be0e87d03685b178ccb1a315f52e',
# created_at: 1230981305,
# kind: 1,
# tags: [],
# content: 'Your feedback is appreciated, now pay $8',
# sig: '123ac2923b792ce730b3da34f16155470ab13c8f97f9c53eaeb334f1fb3a5dc9a7f643
# 937c6d6e9855477638f5655c5d89c9aa5501ea9b578a66aced4f1cd7b3'
# )
#
# @param id [String|nil] 32-bytes sha256 of the the serialized event data.
# @param sig [String|nil] 64-bytes signature of the sha256 hash of the serialized event data, which is
Expand Down
8 changes: 4 additions & 4 deletions lib/nostr/events/encrypted_direct_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ class EncryptedDirectMessage < Event
# @api public
#
# @example Instantiating a new encrypted direct message
# Nostr::Events::EncryptedDirectMessage.new(
# Nostr::Events::EncryptedDirectMessage.new(
# sender_private_key: 'ccf9fdf3e1466d7c20969c71ec98defcf5f54aee088513e1b73ccb7bd770d460',
# recipient_public_key: '48df4af6e240ac5f7c5de89bf5941b249880be0e87d03685b178ccb1a315f52e',
# plain_text: 'Your feedback is appreciated, now pay $8',
# )
# )
#
# @example Instantiating a new encrypted direct message that references a previous direct message
# Nostr::Events::EncryptedDirectMessage.new(
# Nostr::Events::EncryptedDirectMessage.new(
# sender_private_key: 'ccf9fdf3e1466d7c20969c71ec98defcf5f54aee088513e1b73ccb7bd770d460',
# recipient_public_key: '48df4af6e240ac5f7c5de89bf5941b249880be0e87d03685b178ccb1a315f52e',
# plain_text: 'Your feedback is appreciated, now pay $8',
# previous_direct_message: 'ccf9fdf3e1466d7c20969c71ec98defcf5f54aee088513e1b73ccb7bd770d460'
# )
# )
#
# @param plain_text [String] The +content+ of the encrypted message.
# @param sender_private_key [PrivateKey] 32-bytes hex-encoded private key of the message's author.
Expand Down
17 changes: 10 additions & 7 deletions lib/nostr/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ def initialize(**kwargs)
# @api public
#
# @example
# filter.to_h # => {:ids=>["c24881c305c5cfb7c1168be7e9b0e150"],
# :authors=>["000000001c5c45196786e79f83d21fe801549fdc98e2c26f96dcef068a5dbcd7"],
# :kinds=>[0, 1, 2],
# :"#e"=>["7bdb422f254194ae4bb86d354c0bd5a888fce233ffc77dceb3e844ceec1fcfb2"],
# :"#p"=>["000000001c5c45196786e79f83d21fe801549fdc98e2c26f96dcef068a5dbcd7"],
# :since=>1230981305,
# :until=>1292190341}
# filter.to_h # =>
# {
# ids: ['c24881c305c5cfb7c1168be7e9b0e150'],
# authors: ['000000001c5c45196786e79f83d21fe801549fdc98e2c26f96dcef068a5dbcd7'],
# kinds: [0, 1, 2],
# '#e': ['7bdb422f254194ae4bb86d354c0bd5a888fce233ffc77dceb3e844ceec1fcfb2'],
# '#p': ['000000001c5c45196786e79f83d21fe801549fdc98e2c26f96dcef068a5dbcd7'],
# since: 1230981305,
# until: 1292190341
# }
#
# @return [Hash] The filter as a hash.
#
Expand Down

0 comments on commit c064a8d

Please sign in to comment.