Class: Teems::Commands::Activity

Inherits:
Base
  • Object
show all
Includes:
ActivityFormatting
Defined in:
lib/teems/commands/activity.rb

Overview

Show activity feed (mentions, reactions, calendar notifications)

Constant Summary collapse

NOTIFICATION_THREAD =
'48:notifications'
ACTIVITY_OPTIONS =
{
  '--unread' => ->(opts, _pending) { opts[:unread] = true }
}.freeze

Constants included from ActivityFormatting

Teems::Commands::ActivityFormatting::ACTIVITY_DESCRIPTIONS, Teems::Commands::ActivityFormatting::END_DATETIME_PATTERN, Teems::Commands::ActivityFormatting::MAX_PREVIEW, Teems::Commands::ActivityFormatting::START_DATETIME_PATTERN

Instance Attribute Summary

Attributes inherited from Base

#options, #positional_args, #runner

Instance Method Summary collapse

Constructor Details

#initialize(args, runner:) ⇒ Activity

Returns a new instance of Activity.



109
110
111
112
# File 'lib/teems/commands/activity.rb', line 109

def initialize(args, runner:)
  @options = {}
  super
end

Instance Method Details

#executeObject



114
115
116
117
118
119
120
121
122
# File 'lib/teems/commands/activity.rb', line 114

def execute
  result = validate_options
  return result if result

  auth_result = require_auth
  return auth_result if auth_result

  show_activity
end