Simplify the nullable RBS types

This commit is contained in:
Wilson Silva 2024-03-14 22:03:50 +00:00
parent 01010c763f
commit 7c571d3b12
No known key found for this signature in database
GPG Key ID: 65135F94E23F82C8

View File

@ -5,7 +5,7 @@ module Nostr
attr_reader kind: Integer attr_reader kind: Integer
attr_reader tags: Array[Array[String]] attr_reader tags: Array[Array[String]]
attr_reader content: String attr_reader content: String
attr_accessor id: String?|nil attr_accessor id: String?
attr_accessor sig: Signature? attr_accessor sig: Signature?
def initialize: ( def initialize: (
@ -14,20 +14,20 @@ module Nostr
content: String, content: String,
?created_at: Integer, ?created_at: Integer,
?tags: Array[Array[String]], ?tags: Array[Array[String]],
?id: String|nil, ?id: String?,
?sig: Signature? ?sig: Signature?
) -> void ) -> void
def serialize: -> [Integer, String, Integer, Integer, Array[Array[String]], String] def serialize: -> [Integer, String, Integer, Integer, Array[Array[String]], String]
def to_h: -> { def to_h: -> {
id: String?|nil, id: String?,
pubkey: String, pubkey: String,
created_at: Integer, created_at: Integer,
kind: Integer, kind: Integer,
tags: Array[Array[String]], tags: Array[Array[String]],
content: String, content: String,
sig: String?|nil sig: String?
} }
def ==: (Event other) -> bool def ==: (Event other) -> bool