Make code compatible with Ruby 2.7

Not including specs etc.
This commit is contained in:
Râu Cao
2023-03-08 10:28:46 +07:00
committed by Râu Cao
parent 5497930dd5
commit 03bd5203ca
5 changed files with 21 additions and 17 deletions

View File

@@ -149,7 +149,9 @@ module Nostr
#
# @return [Array<String>] The event's updated list of tags
#
def add_event_reference(event_id) = tags.push(['e', event_id])
def add_event_reference(event_id)
tags.push(['e', event_id])
end
# Adds a reference to a pubkey as a 'p' tag
#
@@ -163,7 +165,9 @@ module Nostr
#
# @return [Array<String>] The event's updated list of tags
#
def add_pubkey_reference(pubkey) = tags.push(['p', pubkey.to_s])
def add_pubkey_reference(pubkey)
tags.push(['p', pubkey.to_s])
end
# Signs an event with the user's private key
#
@@ -212,13 +216,13 @@ module Nostr
#
def to_h
{
id:,
pubkey:,
created_at:,
kind:,
tags:,
content:,
sig:
id: id,
pubkey: pubkey,
created_at: created_at,
kind: kind,
tags: tags,
content: content,
sig: sig
}
end