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.
-
#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) ⇒ 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) ⇒ Event
Returns a new instance of Event.
22 23 24 25 26 |
# File 'lib/tempest/jetstream/decoder.rb', line 22 def initialize(kind:, did:, time_us:, collection:, operation:, rkey:, cid:, text:, created_at:, subject_uri: nil, facets: [], reply_parent_uri: nil) super end |
Instance Attribute Details
#cid ⇒ Object (readonly)
Returns the value of attribute cid
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def cid @cid end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def collection @collection end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def created_at @created_at end |
#did ⇒ Object (readonly)
Returns the value of attribute did
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def did @did end |
#facets ⇒ Object (readonly)
Returns the value of attribute facets
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def facets @facets end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def kind @kind end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def operation @operation end |
#reply_parent_uri ⇒ Object (readonly)
Returns the value of attribute reply_parent_uri
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def reply_parent_uri @reply_parent_uri end |
#rkey ⇒ Object (readonly)
Returns the value of attribute rkey
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def rkey @rkey end |
#subject_uri ⇒ Object (readonly)
Returns the value of attribute subject_uri
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def subject_uri @subject_uri end |
#text ⇒ Object (readonly)
Returns the value of attribute text
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def text @text end |
#time_us ⇒ Object (readonly)
Returns the value of attribute time_us
8 9 10 |
# File 'lib/tempest/jetstream/decoder.rb', line 8 def time_us @time_us end |
Instance Method Details
#at_uri ⇒ Object
44 45 46 |
# File 'lib/tempest/jetstream/decoder.rb', line 44 def at_uri "at://#{did}/#{collection}/#{rkey}" end |
#create? ⇒ Boolean
40 41 42 |
# File 'lib/tempest/jetstream/decoder.rb', line 40 def create? operation == :create end |
#like? ⇒ Boolean
32 33 34 |
# File 'lib/tempest/jetstream/decoder.rb', line 32 def like? collection == "app.bsky.feed.like" end |
#post? ⇒ Boolean
28 29 30 |
# File 'lib/tempest/jetstream/decoder.rb', line 28 def post? collection == "app.bsky.feed.post" end |
#repost? ⇒ Boolean
36 37 38 |
# File 'lib/tempest/jetstream/decoder.rb', line 36 def repost? collection == "app.bsky.feed.repost" end |