Class: Ghundle::Command::Common

Inherits:
Object
  • Object
show all
Defined in:
lib/ghundle/command/common.rb

Overview

Provides the basic interface of a Ghundle command. Includes some helper methods that are available in all command objects.

Inheritors are expected to override the #call instance method, and they will have access to the command-line arguments through the #args method.

Direct Known Subclasses

Fetch, Install, ListAll, ListInstalled, Run, Uninstall

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Common



19
20
21
# File 'lib/ghundle/command/common.rb', line 19

def initialize(*args)
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



13
14
15
# File 'lib/ghundle/command/common.rb', line 13

def args
  @args
end

Class Method Details

.call(*args) ⇒ Object



15
16
17
# File 'lib/ghundle/command/common.rb', line 15

def self.call(*args)
  new(*args).call
end