Class: TestLink::Command::Definition

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

Direct Known Subclasses

Base

Constant Summary collapse

@@arguments =
{}

Class Method Summary collapse

Class Method Details

.argument(name, options = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/test_link/command/definition.rb', line 23

def self.argument name, options = {}
  options = {
      :default => nil,
      :mandatory => false
  }.merge(options)
  name = name.intern
  attr_accessor name
  self.arguments[name] = Argument.new options[:default], options[:mandatory]
end

.argumentsObject



33
34
35
36
# File 'lib/test_link/command/definition.rb', line 33

def self.arguments
  @@arguments[self.command_name] = {} if @@arguments[self.command_name].nil?
  @@arguments[self.command_name]
end

.command_nameObject



38
39
40
41
42
# File 'lib/test_link/command/definition.rb', line 38

def self.command_name
  classname = self.name.split('::').last
  classname[0] = classname[0].downcase
  classname
end