Class: Tempest::Jetstream::Event

Inherits:
Data
  • Object
show all
Defined in:
lib/tempest/jetstream/decoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cidObject (readonly)

Returns the value of attribute cid

Returns:

  • (Object)

    the current value of cid



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def cid
  @cid
end

#collectionObject (readonly)

Returns the value of attribute collection

Returns:

  • (Object)

    the current value of collection



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def collection
  @collection
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def created_at
  @created_at
end

#didObject (readonly)

Returns the value of attribute did

Returns:

  • (Object)

    the current value of did



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def did
  @did
end

#facetsObject (readonly)

Returns the value of attribute facets

Returns:

  • (Object)

    the current value of facets



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def facets
  @facets
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def kind
  @kind
end

#operationObject (readonly)

Returns the value of attribute operation

Returns:

  • (Object)

    the current value of operation



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def operation
  @operation
end

#reply_parent_uriObject (readonly)

Returns the value of attribute reply_parent_uri

Returns:

  • (Object)

    the current value of reply_parent_uri



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def reply_parent_uri
  @reply_parent_uri
end

#rkeyObject (readonly)

Returns the value of attribute rkey

Returns:

  • (Object)

    the current value of rkey



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def rkey
  @rkey
end

#subject_uriObject (readonly)

Returns the value of attribute subject_uri

Returns:

  • (Object)

    the current value of subject_uri



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def subject_uri
  @subject_uri
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def text
  @text
end

#time_usObject (readonly)

Returns the value of attribute time_us

Returns:

  • (Object)

    the current value of time_us



8
9
10
# File 'lib/tempest/jetstream/decoder.rb', line 8

def time_us
  @time_us
end

Instance Method Details

#at_uriObject



44
45
46
# File 'lib/tempest/jetstream/decoder.rb', line 44

def at_uri
  "at://#{did}/#{collection}/#{rkey}"
end

#create?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/tempest/jetstream/decoder.rb', line 40

def create?
  operation == :create
end

#like?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/tempest/jetstream/decoder.rb', line 32

def like?
  collection == "app.bsky.feed.like"
end

#post?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/tempest/jetstream/decoder.rb', line 28

def post?
  collection == "app.bsky.feed.post"
end

#repost?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/tempest/jetstream/decoder.rb', line 36

def repost?
  collection == "app.bsky.feed.repost"
end