Class: RSGem::Tasks::Base

Inherits:
Object
  • Object
show all
Includes:
Output
Defined in:
lib/rsgem/tasks/base.rb

Overview

Base class for task objects. Child classes must implement the instance method perform.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Output

#with_output

Constructor Details

#initialize(context:, **args) ⇒ Base

Returns a new instance of Base.



14
15
16
17
# File 'lib/rsgem/tasks/base.rb', line 14

def initialize(context:, **args)
  @context = context
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



12
13
14
# File 'lib/rsgem/tasks/base.rb', line 12

def args
  @args
end

#contextObject (readonly)

Returns the value of attribute context.



12
13
14
# File 'lib/rsgem/tasks/base.rb', line 12

def context
  @context
end

Instance Method Details

#callObject



19
20
21
22
23
# File 'lib/rsgem/tasks/base.rb', line 19

def call
  with_output do
    perform
  end
end