Class: Lazybird::Tasks::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/lazybird/tasks/task.rb

Direct Known Subclasses

RetweetRandomTask, StormQuoteTask

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command:, twitter_client: Lazybird::TwitterClient, **opts) ⇒ Task

Returns a new instance of Task.



8
9
10
11
12
13
# File 'lib/lazybird/tasks/task.rb', line 8

def initialize(command:, twitter_client: Lazybird::TwitterClient, **opts)
  # TODO define command on subclass
  @command = command
  @opts = opts
  @twitter_client = twitter_client
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



6
7
8
# File 'lib/lazybird/tasks/task.rb', line 6

def command
  @command
end

#optsObject (readonly)

Returns the value of attribute opts.



6
7
8
# File 'lib/lazybird/tasks/task.rb', line 6

def opts
  @opts
end

Instance Method Details

#runObject

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/lazybird/tasks/task.rb', line 15

def run
  raise NotImplementedError
end