Class: Is::Command

Inherits:
Object
  • Object
show all
Includes:
Mixin
Defined in:
lib/is/command.rb

Defined Under Namespace

Modules: Mixin Classes: Application

Constant Summary collapse

VERSION =
'0.9.3'

Instance Attribute Summary

Attributes included from Mixin

#description, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixin

#[], #action, #command, #commons, #default, #each, #fullname, #help, #key, messages, #parse, #process, #synonym, #to_proc

Constructor Details

#initialize(up, name, *description, &block) ⇒ Command

Returns a new instance of Command.



342
343
344
345
346
347
# File 'lib/is/command.rb', line 342

def initialize up, name, *description, &block
  @up = up
  @name = name.intern if name
  @description = description
  instance_eval &block
end

Class Method Details

.runapp(name = nil, *description) { ... } ⇒ Object?

Parameters:

  • name (Symbol, String, nil) (defaults to: nil)
  • description (Array<String>)

Yields:

Returns:

  • (Object, nil)


333
334
335
336
# File 'lib/is/command.rb', line 333

def runapp name = nil, *description, &block
  app = Command::Application.new name, *description, &block
  app.run
end