Class: Ellipses::Client::Command

Inherits:
Object
  • Object
show all
Extended by:
DSL
Defined in:
lib/ellipses/client/command.rb

Defined Under Namespace

Modules: DSL, Mixins Classes: Proto

Constant Summary collapse

Error =
Class.new Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL

command

Constructor Details

#initialize(argv, server) ⇒ Command

Returns a new instance of Command.



42
43
44
45
46
47
48
# File 'lib/ellipses/client/command.rb', line 42

def initialize(argv, server)
  @argv   = argv
  @server = server
  @param  = OpenStruct.new

  setup
end

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



40
41
42
# File 'lib/ellipses/client/command.rb', line 40

def argv
  @argv
end

#serverObject (readonly)

Returns the value of attribute server.



40
41
42
# File 'lib/ellipses/client/command.rb', line 40

def server
  @server
end

Instance Method Details

#call(input, **kwargs) ⇒ Object

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/ellipses/client/command.rb', line 52

def call(input, **kwargs)
  raise NotImplementedError
end

#error(*args) ⇒ Object

Raises:



56
57
58
# File 'lib/ellipses/client/command.rb', line 56

def error(*args)
  raise Error, *args
end

#setupObject



50
# File 'lib/ellipses/client/command.rb', line 50

def setup; end

#to_sObject



60
61
62
# File 'lib/ellipses/client/command.rb', line 60

def to_s
  self.class.name.downcase
end