Class: Elscripto::Command

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Command

Returns a new instance of Command.



5
6
7
8
9
10
# File 'lib/elscripto/command.rb', line 5

def initialize name, options = {}
  raise ArgumentError.new 'Elscripto commands need a name spectacularrr' if blank? name
  @name = name
  @system_call = blank?(options[:command]) ? builtin_commands[name] : options.delete(:command)
  raise ArgumentError.new 'Elscripto commands need a command spectacularrr' if blank? @system_call
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/elscripto/command.rb', line 3

def name
  @name
end

#system_callObject (readonly)

Returns the value of attribute system_call.



3
4
5
# File 'lib/elscripto/command.rb', line 3

def system_call
  @system_call
end