Class: Cosmos::CalendarTopic

Inherits:
Topic show all
Defined in:
lib/cosmos/topics/calendar_topic.rb

Constant Summary collapse

PRIMARY_KEY =
'__cosmos_calendar'.freeze

Class Method Summary collapse

Methods inherited from Topic

clear_topics, initialize_streams, read_topics, topics

Class Method Details

.write_entry(entry, scope:) ⇒ Object

Write an activity to the topic

“‘json

{
  "type" => "metadata",
  "kind" => "created",
  "metadata" => {
    "target" => "FOO",
    "start" => 1621875570,
    "color" => "#FF0000",
    "metadata" => {"test"=>"123456"}
  },
}

“‘



40
41
42
# File 'lib/cosmos/topics/calendar_topic.rb', line 40

def self.write_entry(entry, scope:)
  Store.write_topic("#{scope}#{PRIMARY_KEY}", entry, '*', 1000)
end