Class: Fuelcell::Action::NotFound

Inherits:
Command
  • Object
show all
Defined in:
lib/fuelcell/action/not_found.rb

Overview

Null Object used to indicate a command has not been found

Instance Attribute Summary

Attributes inherited from Command

#args, #name, #opts

Instance Method Summary collapse

Methods inherited from Command

#add_global_options

Methods included from Callable

#call, #callable?

Methods included from Subcommands

#[], #add, #exist?, #global_options, #search

Constructor Details

#initialize(cmd_args) ⇒ NotFound

Returns a new instance of NotFound.



5
6
7
8
9
10
11
# File 'lib/fuelcell/action/not_found.rb', line 5

def initialize(cmd_args)
  super(validate_cmd_args(cmd_args))

  @callable = command_not_found_action
  @usage    = ''
  @desc     = 'command not found command'
end

Instance Method Details

#<<(_cmd) ⇒ Object



34
35
# File 'lib/fuelcell/action/not_found.rb', line 34

def <<(_cmd)
end

#callable(_value = nil) ⇒ Object



21
22
23
# File 'lib/fuelcell/action/not_found.rb', line 21

def callable(_value = nil)
  @callable
end

#command(key, &block) ⇒ Object



25
26
27
28
29
# File 'lib/fuelcell/action/not_found.rb', line 25

def command(key, &block)
  cmd = Command.new(key)
  cmd.instance_eval(&block)
  nil
end

#desc(_value = nil) ⇒ Object



17
18
19
# File 'lib/fuelcell/action/not_found.rb', line 17

def desc(_value = nil)
  @desc
end

#opt(_name, _config = {}) ⇒ Object



31
32
# File 'lib/fuelcell/action/not_found.rb', line 31

def opt(_name, _config = {})
end

#usage(_value = nil) ⇒ Object



13
14
15
# File 'lib/fuelcell/action/not_found.rb', line 13

def usage(_value = nil)
  @usage
end