Class: Lambit::Commands::Common::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lambit/commands/common.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts, args) ⇒ Base

Returns a new instance of Base.



47
48
49
50
# File 'lib/lambit/commands/common.rb', line 47

def initialize(opts, args)
  @dry_run          = opts['dry-run']
  @exitstatus       = 1
end

Instance Attribute Details

#dry_runObject (readonly)

Returns the value of attribute dry_run.



44
45
46
# File 'lib/lambit/commands/common.rb', line 44

def dry_run
  @dry_run
end

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



45
46
47
# File 'lib/lambit/commands/common.rb', line 45

def exitstatus
  @exitstatus
end

#runObject (readonly)

Returns the value of attribute run.



43
44
45
# File 'lib/lambit/commands/common.rb', line 43

def run
  @run
end

Class Method Details

.run(opts, args) ⇒ Object



52
53
54
55
# File 'lib/lambit/commands/common.rb', line 52

def self.run(opts, args)
  output, exitstatus = self.new(opts, args).execute
  return output, exitstatus
end

Instance Method Details

#commandObject



57
58
59
# File 'lib/lambit/commands/common.rb', line 57

def command
  return '', self.exitstatus
end

#executeObject



61
62
63
# File 'lib/lambit/commands/common.rb', line 61

def execute
  command
end