Class: Abt::BaseCommand

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/abt/base_command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ari:, cli:) ⇒ BaseCommand

Returns a new instance of BaseCommand.



23
24
25
26
27
# File 'lib/abt/base_command.rb', line 23

def initialize(ari:, cli:)
  @cli = cli
  @ari = ari
  @flags = parse_flags(ari.flags)
end

Instance Attribute Details

#ariObject (readonly)

Returns the value of attribute ari.



19
20
21
# File 'lib/abt/base_command.rb', line 19

def ari
  @ari
end

#cliObject (readonly)

Returns the value of attribute cli.



19
20
21
# File 'lib/abt/base_command.rb', line 19

def cli
  @cli
end

#flagsObject (readonly)

Returns the value of attribute flags.



19
20
21
# File 'lib/abt/base_command.rb', line 19

def flags
  @flags
end

Class Method Details

.descriptionObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/abt/base_command.rb', line 11

def self.description
  raise NotImplementedError, "Command classes must implement .description"
end

.flagsObject



15
16
17
# File 'lib/abt/base_command.rb', line 15

def self.flags
  []
end

.usageObject

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/abt/base_command.rb', line 7

def self.usage
  raise NotImplementedError, "Command classes must implement .usage"
end

Instance Method Details

#performObject

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/abt/base_command.rb', line 29

def perform
  raise NotImplementedError, "Command classes must implement #perform"
end