Class: Tempest::Jetstream::Event
- Inherits:
-
Data
- Object
- Data
- Tempest::Jetstream::Event
- Defined in:
- lib/tempest/jetstream/decoder.rb
Instance Attribute Summary collapse
-
#cid ⇒ Object
readonly
Returns the value of attribute cid.
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#did ⇒ Object
readonly
Returns the value of attribute did.
-
#embed_kind ⇒ Object
readonly
Returns the value of attribute embed_kind.
-
#facets ⇒ Object
readonly
Returns the value of attribute facets.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#reply_parent_uri ⇒ Object
readonly
Returns the value of attribute reply_parent_uri.
-
#rkey ⇒ Object
readonly
Returns the value of attribute rkey.
-
#subject_uri ⇒ Object
readonly
Returns the value of attribute subject_uri.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#time_us ⇒ Object
readonly
Returns the value of attribute time_us.
Instance Method Summary collapse
- #at_uri ⇒ Object
- #create? ⇒ Boolean
-
#initialize(kind:, did:, time_us:, collection:, operation:, rkey:, cid:, text:, created_at:, subject_uri: nil, facets: [], reply_parent_uri: nil, embed_kind: nil) ⇒ Event
constructor
A new instance of Event.
- #like? ⇒ Boolean
- #post? ⇒ Boolean
- #repost? ⇒ Boolean
Constructor Details
#initialize(kind:, did:, time_us:, collection:, operation:, rkey:, cid:, text:, created_at:, subject_uri: nil, facets: [], reply_parent_uri: nil, embed_kind: nil) ⇒ Event
Returns a new instance of Event.
24 25 26 27 28 |
# File 'lib/tempest/jetstream/decoder.rb', line 24 def initialize(kind:, did:, time_us:, collection:, operation:, rkey:, cid:, text:, created_at:, subject_uri: nil, facets: [], reply_parent_uri: nil, embed_kind: nil) super end |
Instance Attribute Details
#cid ⇒ Object (readonly)
Returns the value of attribute cid
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def cid @cid end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def collection @collection end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def created_at @created_at end |
#did ⇒ Object (readonly)
Returns the value of attribute did
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def did @did end |
#embed_kind ⇒ Object (readonly)
Returns the value of attribute embed_kind
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def @embed_kind end |
#facets ⇒ Object (readonly)
Returns the value of attribute facets
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def facets @facets end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def kind @kind end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def operation @operation end |
#reply_parent_uri ⇒ Object (readonly)
Returns the value of attribute reply_parent_uri
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def reply_parent_uri @reply_parent_uri end |
#rkey ⇒ Object (readonly)
Returns the value of attribute rkey
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def rkey @rkey end |
#subject_uri ⇒ Object (readonly)
Returns the value of attribute subject_uri
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def subject_uri @subject_uri end |
#text ⇒ Object (readonly)
Returns the value of attribute text
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def text @text end |
#time_us ⇒ Object (readonly)
Returns the value of attribute time_us
9 10 11 |
# File 'lib/tempest/jetstream/decoder.rb', line 9 def time_us @time_us end |
Instance Method Details
#at_uri ⇒ Object
46 47 48 |
# File 'lib/tempest/jetstream/decoder.rb', line 46 def at_uri "at://#{did}/#{collection}/#{rkey}" end |
#create? ⇒ Boolean
42 43 44 |
# File 'lib/tempest/jetstream/decoder.rb', line 42 def create? operation == :create end |
#like? ⇒ Boolean
34 35 36 |
# File 'lib/tempest/jetstream/decoder.rb', line 34 def like? collection == "app.bsky.feed.like" end |
#post? ⇒ Boolean
30 31 32 |
# File 'lib/tempest/jetstream/decoder.rb', line 30 def post? collection == "app.bsky.feed.post" end |
#repost? ⇒ Boolean
38 39 40 |
# File 'lib/tempest/jetstream/decoder.rb', line 38 def repost? collection == "app.bsky.feed.repost" end |