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, 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

#cidObject (readonly)

Returns the value of attribute cid

Returns:

  • (Object)

    the current value of cid



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

def cid
  @cid
end

#collectionObject (readonly)

Returns the value of attribute collection

Returns:

  • (Object)

    the current value of collection



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

def collection
  @collection
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



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

def created_at
  @created_at
end

#didObject (readonly)

Returns the value of attribute did

Returns:

  • (Object)

    the current value of did



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

def did
  @did
end

#embed_kindObject (readonly)

Returns the value of attribute embed_kind

Returns:

  • (Object)

    the current value of embed_kind



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

def embed_kind
  @embed_kind
end

#facetsObject (readonly)

Returns the value of attribute facets

Returns:

  • (Object)

    the current value of facets



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

def facets
  @facets
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



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

def kind
  @kind
end

#operationObject (readonly)

Returns the value of attribute operation

Returns:

  • (Object)

    the current value of operation



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

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



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

def reply_parent_uri
  @reply_parent_uri
end

#rkeyObject (readonly)

Returns the value of attribute rkey

Returns:

  • (Object)

    the current value of rkey



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

def rkey
  @rkey
end

#subject_uriObject (readonly)

Returns the value of attribute subject_uri

Returns:

  • (Object)

    the current value of subject_uri



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

def subject_uri
  @subject_uri
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



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

def text
  @text
end

#time_usObject (readonly)

Returns the value of attribute time_us

Returns:

  • (Object)

    the current value of time_us



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

def time_us
  @time_us
end

Instance Method Details

#at_uriObject



46
47
48
# File 'lib/tempest/jetstream/decoder.rb', line 46

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

#create?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/tempest/jetstream/decoder.rb', line 42

def create?
  operation == :create
end

#like?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/tempest/jetstream/decoder.rb', line 34

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

#post?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/tempest/jetstream/decoder.rb', line 30

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

#repost?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/tempest/jetstream/decoder.rb', line 38

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